Custom UITextField clear button

前端 未结 7 754
渐次进展
渐次进展 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:05

    One approach would be to create a custom UITextField that has your desired image as a subview and clears the parent text field when tapped. You disable the default button and add your custom behavior in this custom text field.

    This should get you started. If there are any more concrete questions, feel free to edit your question or comment here if it's a minor problem.

提交回复
热议问题