When editing in a UITextView, I know how to change the cursor color by setting tintColor. Is there any why to change cursor to another style?
For example: a blinking fixed-width box. or a underline "_"
I found a solution:
1.Subclassing UITextView
2.Overwrite caretRectForPosition: method
- (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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With