Wednesday, September 22, 2010

iPhone SDK: MoreNavigationController

For those of you, who have more than 5 tab bar items in an iPhone Tab bar controller app. You will have noticed that the SDK automatically adds a More Tab bar item and adds all the subsequent views to a table controller.  And if you click on the More Tab, you will get the options to Configure and Edit.


This is ok for the most part. However, if your views have a custom Navigation bar item at the top of the view, having a More Navigation bar at the top and your navigation bar below it can prove to be annoying and does not lead to a nice user experience.


You can customize the More Navigation controller by the following. In your app delegate file, 
add the following lines of code in the method


-(bool) application.....didFinishLaunchingWithOptions: (NSDictionary *)......
{


//this hides the more navigation bar, you will have to write your own logic to navigate back to the previous view.
tabBarController.moreNavigationController.navigationBar.hidden = YES;


[window addSubView: tabBarController.view];
[window makeKeyAndVisible];


}

No comments: