在编辑UITextView时,我知道可以通过设置tintColor来更改光标颜色。但是否有办法将光标更改为其他样式呢?
例如:一个闪烁的固定宽度框或者下划线“_”
在编辑UITextView时,我知道可以通过设置tintColor来更改光标颜色。但是否有办法将光标更改为其他样式呢?
例如:一个闪烁的固定宽度框或者下划线“_”
- (CGRect)caretRectForPosition:(UITextPosition *)position
{
CGRect myRect = [super caretRectForPosition:position];
myRect.size.width = 5; // Modify the width of the caret
myRect.size.height = 5; // Modify the height of the caret
return myRect;
}