【发布时间】:2013-11-02 21:13:06
【问题描述】:
我在 iOS6 中使用了以下方法,但在 iOS7 中我遇到了错误
CGSize labelHeight = [tweetText sizeWithFont:[UIFont systemFontOfSize:13.0f] constrainedToSize:CGSizeMake(self.tweetsTableView.bounds.size.width - 84, 4000)];
下面的完整方法,关于如何修改iOS7的任何想法?
- (CGFloat)heightForCellAtIndex:(NSUInteger)index {
NSDictionary *tweet = self.tweets[index];
CGFloat cellHeight = 50;
NSString *tweetText = tweet[@"text"];
CGSize labelHeight = [tweetText sizeWithFont:[UIFont systemFontOfSize:13.0f] constrainedToSize:CGSizeMake(self.tweetsTableView.bounds.size.width - 84, 4000)];
cellHeight += labelHeight.height;
return cellHeight;
}
【问题讨论】:
标签: ios7 sizewithfont