Reputation: 5098
Is there a way to have a UITextField with the text read only but still let the clear button work? I have a set of buttons on my view that interact with the text field so i dont need the keyboard to pop but if i disable the text field. the clear button shows up but i cant press it anymore. Is there a way to do this or should i make my own clear button?
Upvotes: 2
Views: 1209
Reputation: 94794
Set clearButtonMode
to UITextFieldViewModeAlways, and have the delegate return NO for textFieldShouldBeginEditing:
.
Upvotes: 4