4
如何在iOS 7 SDK中獲得NSString
的CGSize
值,只需要將sizeWithAttributes
轉換爲下面的代碼行即可。如何將sizeWithFont轉換爲sizeWithAttributes(iOS 7)
CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:NSLineBreakByWordWrapping];
可能重複[iOS的7 sizeWithAttributes:更換sizeWithFont:constrainedToSize(http://stackoverflow.com /問題/ 19145078/IOS -7- sizewithattributes替換換sizewithfontconstrainedtosize) – BB9z