'sizeWithFont:constrainedToSize:' is deprecated: first deprecated in iOS 7.0 - Use -boundingRectWithSize:options:attributes:context:

解决方法:
 
NSString *myText = @"xxxxx";
CGSize mySize =[myText sizeWithFont:myFont constrainedToSize:CGSizeMake(200,100)];
 
改写成:

CGSize mySize = [myText boundingRectWithSize:CGSizeMake(200,100) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:myFont} context:nil].size;

文章来自:http://www.cnblogs.com/tonyxu/p/4297337.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3