DEPRECATED方法 修改

使用中经常会遇到,特意总结一下:

原方法名 功能 摒弃版本 推荐方法 使用方式
sizeWithFont 根据字体大小获取size iOS7.0 sizeWithAttributes

参数Dictionary

key:参考NSAttributeString.h

例子

NSMutableParagraphStyle* paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];

paragraphStyle.lineBreakMode = NSLineBreakByClipping;

paragraphStyle.alignment     = textAlignment;

CGSize title1Size = [text sizeWithAttributes:@{NSFontAttributeName : font

,NSParagraphStyleAttributeName:paragraphStyle

}];

 

 

持续更新中    

    

posted on 2016-10-28 15:24  侠情小飞  阅读(217)  评论(0编辑  收藏  举报

导航