我有以下警告使用代码中的iOS 7.0会显示使用sizeWithAttribute:
这里是下面的代码,我已经使用:sizeWithFont IOS 7.0弃用
messageSize = [theMessage sizeWithFont:[UIFont systemFontOfSize:20.0]];
如果任何人有意见怎么上述去除代码sizeWithAttribute:
所以请告诉我。先谢谢了。
我有以下警告使用代码中的iOS 7.0会显示使用sizeWithAttribute:
这里是下面的代码,我已经使用:sizeWithFont IOS 7.0弃用
messageSize = [theMessage sizeWithFont:[UIFont systemFontOfSize:20.0]];
如果任何人有意见怎么上述去除代码sizeWithAttribute:
所以请告诉我。先谢谢了。
使用sizeWithAttributes:相反,它现在需要一个NSDictionary。通过在对与关键UITextAttributeFont和您的字体对象是这样的:
CGSize size = [string sizeWithAttributes:
@{NSFontAttributeName:
[UIFont systemFontOfSize:20.0f]}];
感谢
尝试张贴问题之前,做一些搜索。 –