Setting the height of the UINavigationBar

I have set a UINavigationBar background image to an image with a height of 68px as opposed to the default 44px. Now the image is shown fine, but the content in the UINavigationController is overlapped in the first (68-44)px = 12px by the header image.

How do I fix this? I have tried setting the frame of the UINavigationBar without luck.

Thanks, Caspar.

This is my code (AppDelegate.m):

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.frontTableViewController];
UINavigationBar *navBar = navigationController.navigationBar;
[navBar setBackgroundImage:[UIImage imageNamed:@"header"] forBarMetrics:UIBarMetricsDefault];
self.window.rootViewController = navigationController;

Answers


try setting the image for the navigationbar this way

self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myNavBarImage.png"]];

or have a look at this Answer


Need Your Help

Unique Virtual Machine

licensing unique virtual-pc copy-protection

I am working on some method to protect my software with a license. Doing some wmi calls to uniquely distinguish computers and making sure there cannot be loaded multiple instances of the applicatio...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.