I\'ve started playing with iOS 5 today and I\'ve seen that XCode 4.2 only let me select iOS 5 as Base SDK but not iOS 4.
Until now I\'ve overwriting drawRect: method in
Another way to customized your header is like this.
UIImage *image = [UIImage imageNamed:@"header.png"];
if([navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] ) {
//iOS 5 new UINavigationBar custom background
[navigationBar setBackgroundImage:image forBarMetrics: UIBarMetricsDefault];
}
else{
UIImageView *imgView = [[[UIImageView alloc] initWithImage:image] autorelease];
[imgView setUserInteractionEnabled:NO];
[imgView setTag:TOOLBAR_TAG];
[navigationBar insertSubview:imgView atIndex:0];
}
Using the respondsToSelector you can know if the function is here.