Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear button color on text field

How do you change the clear button color of a UITextField?

like image 462
quano Avatar asked Feb 24 '10 02:02

quano


1 Answers

You want to use rightView and rightViewMode. Use a button and add an image that is a red clear button. Then add your target and perform your logic.

rightViewRectForBounds will also return the size of the button for the rightView.

like image 62
bstahlhood Avatar answered Oct 15 '22 04:10

bstahlhood