0
當我使用boundingRectWithSize來計算文本的高度時,它會崩潰。我發現它可能是因爲文本中有一些表情符號。有人可以告訴我如何解決這個問題。boundingRectWithSize與表情符號崩潰
CGFloat kScreenMargin = 15.;
CGFloat kScreenWidth = [UIScreen mainScreen].bounds.size.width;
self.content = @"Eefggg";
CGFloat contentH = [self.content boundingRectWithSize:CGSizeMake(kScreenWidth - 2 * kScreenMargin, MAXFLOAT)
options:NSStringDrawingUsesLineFragmentOrigin
attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} context:nil].size.height;
如何做好中國 – iCloudy
@iCloudy http://stackoverflow.com/questions/14619316/chiness -charecter-編碼問題,iphone – 2017-02-28 06:32:37