首页 > UITextView大小

UITextView大小

使用UITextView,指定UITextView的区域大小,指定显示字体大小,怎么计算该区域能输入多少字符


NSString 的 boundingRectWithSize:options:attributes:context:
参见:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/NSString_UIKit_Additions/Reference/Reference.html#//apple_ref/occ/instm/NSString/boundingRectWithSize:options:attributes:context:
可以用逐步探测的方式,获取一行文本的高、宽,再进行字数计算

【热门文章】
【热门文章】