Change UITextField and UITextView Cursor / Caret Color

前端 未结 16 2054
醉话见心
醉话见心 2020-12-07 09:33

I\'m wondering about changing the color of the cursor / caret in a UITextField (And UITextView if its the same answer) in iOS. I\'ve seen answers f

16条回答
  •  悲&欢浪女
    2020-12-07 10:02

    A more general approach would be to set the UIView's appearance's tintColor.

    UIColor *myColor = [UIColor purpleColor];
    [[UIView appearance] setTintColor:myColor];
    

    Makes sense if you're using many default UI elements.

提交回复
热议问题