self.iContextText = [[UITextView alloc] initWithFrame:CGRectMake(5, 5, self.view.frame.size.width-20, 110)];
self.iContextText.textColor = [UIColor lightGrayColor];
self.iContextText.delegate = self;
self.iContextText.font = [UIFont systemFontOfSize:14];
self.iContextText.selectedRange=NSMakeRange(0,0);
self.iContextText.contentOffset = CGPointMake(0, 0);
以下一行代码即可实现控制光标位置:
self.iContextText.contentInset = UIEdgeInsetsMake(-70, 0, 0, 0);
本文详细介绍了如何使用Objective-C为UIKit框架中的`UITextView`控件自定义光标位置及文本属性,包括颜色、字体大小、选区范围等,并通过实例代码演示了具体操作。
1754

被折叠的 条评论
为什么被折叠?



