In my iOS5 iPhone application, i\'m setting the tint color of search bar using following code:
searchBar.tintColor = UIColorMake(@\"#EFEFEF\");
You could search for UISearchBar
subViews and locate the cancel button, it is dangerous to do so, since the button could change
For example you could add this in your viewWillAppear
- (void) viewWillAppear:(BOOL)animated
{
//show the cancel button in your search bar
searchBar.showsCancelButton = YES;
//Iterate the searchbar sub views
for (UIView *subView in searchBar.subviews) {
//Find the button
if([subView isKindOfClass:[UIButton class]])
{
//Change its properties
UIButton *cancelButton = (UIButton *)[sb.subviews lastObject];
cancelButton.titleLabel.text = @"Changed";
}
}
}
As i said before this could change, its a hack to do so, you better stick with the original, or create your own search bar.