Hi,
I have created a application with UINavigationController and it is appearing fine now i want to make the size of the NavigationController to a smaller size. How can i do it?
Hi,
I have created a application with UINavigationController and it is appearing fine now i want to make the size of the NavigationController to a smaller size. How can i do it?
You can't.
According to the UINavigationController documentation, the only options you have to change the look are the barStyle and the translucent properties;
With only a few exceptions, you should never modify the navigation bar object directly. It is permissible to modify the barStyle or translucent properties of the navigation bar but you must never change its frame, bounds, or alpha values directly. In addition, the navigation controller object builds the contents of the navigation bar dynamically using the navigation items (instances of the UINavigationItem class) associated with the view controllers on the navigation stack. To change the contents of the navigation bar, you must therefore configure the navigation items for your custom view controllers. For more information about navigation items, see UINavigationItem Class Reference.
IMPORTANT: this idea sounded great in and seemed to work in theory, but the iAd framework doesn't allow you to add an AdBannerView directly to the UIWindow. <<<<<
You can resize a UINavigationController but you cannot move the top or bottom ToolBar.
Here is an example of making a AdBanner go below your UINavigationController but above it's bottom toolbar. This AdBanner will remain stationary in your view--it will not animated with UIViewController push and pop actions.
1) Resize your UINavigationController in the app delegate:
navigationController.view.frame = CGRectMake(0, 0, 320, 410);
2) Manually resize the ViewControllers to add a gap below. A good place to do this is in viewDidLoad method:
self.view.frame = CGRectMake(0, 0, 320, 322);
3) Add your AdBannerView directly to the application's window (remember it is just another UIView). So the AdBanner would go above the toolbar, but below any visible view controllers.
[window addSubview:addBannerView];
It looks something like this: