开发者

Get text from UITextView

Is it possible to get the first line of text fr开发者_JS百科om a UITextView. I have looked through the UITextView and NSString Class References and can't find any methods that could accomplish this.


The only way to accomplish this is through a process of iteration using the multi line text methods detailed in "NSString UIKit Additions Reference". Extract the first few words from your string and start compositing these gradually until the " sizeWithFont:constrainedToSize:lineBreakMode:" returns a size which height is higher than that of a line with just 1 word.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜