'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;

posted on 2015-02-22 10:31  奶杨  阅读(845)  评论(0编辑  收藏  举报

导航