Change UITextField and UITextView Cursor / Caret Color

前端 未结 16 2028
醉话见心
醉话见心 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 09:57

    Note: This answer is out of date and should be used for pre-iOS 7 development only. See other answers for a 1 line solution using the appearance proxy in iOS 7.

    I arrived at this question after I faced the same problem in a project I was working on.

    I managed to create a solution that will be accepted by the AppStore review team as it does not use any existing Private APIs.

    I have created a control called DGTextField that extends UITextField.

提交回复
热议问题