views:

223

answers:

2

I am using the following piece of code to hide the background on a UISearchBar: [[searchView.subviews objectAtIndex:0] setHidden:YES]; Pretty simple, but I worry about hard coding a position in a subview list. So I went looking for the UISearchBarBackground.h file and cannot find it. Does any know where the definition is hiding?

A: 

To simply use in [subView isKindOfClass:[UISearchBarBackground class]] the following works just fine:

@interface UISearchBarBackground : NSObject { } @end

A more complete definition is available at github.

Jim B
where on github?
Brandon
http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UISearchBarBackground.h
Jim B
A: 

For ios4 it didnt work, so I try this and it works

[[self.mySearchBar.subviews objectAtIndex:0] removeFromSuperview];

Adeem Maqsood Basraa