Custom UITextField clear button images
| Originator: | mczonk | ||
| Number: | rdar://13575435 | Date Originated: | 04-Apr-2013 12:33 PM |
| Status: | Open | Resolved: | |
| Product: | iPhone SDK | Product Version: | 6.1.3 |
| Classification: | Enhancement | Reproducible: | Always |
Summary: There is no way to customize the clear button in a UITextField. There are some tricks like using the rightView property. But this is not the way to go and results in slightly different behavior too. The default clear image is in a dim grey tone. It works fine for black or white backgrounds but it is hard to see on grey ones. Also you might want to follow a custom appearance and therefore you want to style the clear image. It would be pretty easy to customize the clear button. Steps to Reproduce: Expected Results: It would be nice if there are methods like this in a UITextField. - (UIImage*)clearButtonImageForState:(UIControlState)state UI_APPEARANCE_SELECTOR; - (void)setClearButtonImage:(UIImage*)image forState:(UIControlState)state UI_APPEARANCE_SELECTOR; Actual Results: Right now there is a private method: - (UIImage*)_clearButtonImageForState:(UIControlState)state; Regression: I don't want to use private API. So I'm hoping you might solve this issue with iOS 7. files.mczonk.de/TextfieldClearButtonApperance.uip
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!