码迷,mamicode.com
首页 > 其他好文 > 详细

UITextView获取光标位置

时间:2014-10-21 12:16:43      阅读:298      评论:0      收藏:0      [点我收藏+]

标签:iphone   ios   uitextview 光标 位置   

    UITextRange *range = textView.selectedTextRange;

    //光标位置

    CGRect  rect = [textView caretRectForPosition:range.start];

    当UITextView的光标在最后位置连续输入4个或以上换行符号时,输出rect为 {{inf,inf},{0,0}} 

UITextView获取光标位置

标签:iphone   ios   uitextview 光标 位置   

原文地址:http://blog.csdn.net/qq562475163/article/details/40342601

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!