Custom UITextField clear button

前端 未结 7 740
渐次进展
渐次进展 2021-01-31 08:16

Is it possible to customize the image of the clear button in a UITextField? I have a dark textfield background and the \"x\" is not visible enough.

相关标签:
7条回答
  • 2021-01-31 09:14

    Swift 3

    let customClearButton = UIButton.appearance(whenContainedInInstancesOf: [UITextField.self])
    customClearButton.setBackgroundImage(UIImage(named: "custom_cb"), for: .normal)
    
    0 讨论(0)
提交回复
热议问题