Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Change UISearchBar background image?

eladoelado Posts: 3New Users
edited November 2011 in iPhone SDK Development
Is it possible to change UISearchBar's background image?

I tried via a category extension class:
@implementation UISearchBar (CustomBG)
- (void)drawRect:(CGRect)rect {
	UIImage *image = [UIImage imageNamed: @"search-bg.png"];
	[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];

When I put a breakpoint it does enter the function.

With UITabBar/UINavigationBar this code works perfectly.

Post edited by elado on


Sign In or Register to comment.