Change UITextField and UITextView Cursor / Caret Color

前端 未结 16 2061
醉话见心
醉话见心 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条回答
  •  猫巷女王i
    2020-12-07 09:41

    This worked for me in swift:

    UITextField.tintColor = UIColor.blackColor()
    

    You can also set this in storyboard: https://stackoverflow.com/a/18759577/3075340

提交回复
热议问题