Hi,
in Interface Builder, if I drop a UISearchBar into my view, set its style to black and enable the cancel button, here's what I get:
The color of the cancel button is obviously wrong. Only with the following code ...
... I can make the cancel button look how it should:
Is this a bug? Has somebody else encountered this problem? How can I solve the problem without the hack I'm currently using?
Thanks!
in Interface Builder, if I drop a UISearchBar into my view, set its style to black and enable the cancel button, here's what I get:

The color of the cancel button is obviously wrong. Only with the following code ...
Code:
// Assume a UISearchBar searchBar.
NSArray *subviews = [searchBar subviews];
// The index depends on how you configure the searchBar.
UIButton *cancelButton = [subviews objectAtIndex:3];
// Set the style to "normal" style.
[cancelButton setStyle:0];
... I can make the cancel button look how it should:

Is this a bug? Has somebody else encountered this problem? How can I solve the problem without the hack I'm currently using?
Thanks!