In my iOS5 iPhone application, i'm setting the tint color of search bar using following code:
searchBar.tintColor = UIColorMake(@"#EFEFEF");
RGB value of #efefef is (239,239,239)
Its working fine. But when cancel button appears the text "Cancel" is not visible. Can I customize only the cancel button with transparent black and white text on that?
is it possible to customize?
Best Answer
You can customize the Cancel button on iOS 5 by using the appearance proxy. You need to change appearance of
UIBarButtonItem
when contained inUISearchBar
. For example to change the title font of the Cancel button you can use: