Old unanswered thread on the old forums: UITextView Cannot Set Clear Button to Always
I am creating a UITextField in code and setting its clearButtonMode to UITextFieldViewModeAlways. This has no effect (well it's the same as UITextFieldViewModeWhileEditing). The clear button does not appear until the text is non-empty. Same happens if you just drag a UITextField out in IB and set the clear button mode to Always.
I've submitted a bug (21602318) but I'm wondering if there's any workaround. I'm trying to "minimalize" a portion of UI and want the clear button to double as the cancel button. (Tap on search field to expand it and shows the X... tap the X to clear and shrink the search field.) I haven't tried using a custom button in the rightView since I would prefer to use the system-defined clear button.