首页 > 代码库 > 疑难杂症,sizetofit,

疑难杂症,sizetofit,

    CGSize rect = [info.contentsizeWithFont:self.contentLabel.fontconstrainedToSize:CGSizeMake(self.contentLabel.frame.size.width, MAXFLOAT)];

    self.contentLabel.text = info.content;

    self.contentLabel.frame = CGRectMake(self.contentLabel.frame.origin.x, self.contentLabel.frame.origin.y, 250, rect.height);

    self.contentLabel.frame = CGRectMake(self.contentLabel.frame.origin.xself.contentLabel.frame.origin.y,

self.contentLabel.frame.size.width, rect.height);

    [self.contentLabelsizeToFit];