0
votes

I try to show UIView of HomeViewController as modal of TabBarViewController.

I want UIView display over TabBar and there 's TabBar at bottom of screen.

Although, setting setting UIView of HomeController 's width and height to 320 x 320 px does not prevent the view to show full screen. It cover UITabBar and I can not see UITabBar at button of screen when application start up.

This is my code.

//in TabBarWithHomeAppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method

homeViewController = [[HomeViewController alloc]
                      initWithNibName:@"HomeViewController" bundle:nil];


self.window.rootViewController = self.tabBarController;


[self.window makeKeyAndVisible];

self.tabBarController.view.frame = CGRectMake(0, 0, 320, 320);

[self.tabBarController presentModalViewController:homeViewController animated:NO];

return YES;

enter image description here

Interface builder short screen

in Simulator

enter image description here

and this is my source code

link to download source code

Any suggestion is valuable.

Thanks,

1
Modal views are always presented in full screen on the iPhone. You need to use a UIView as a subview of your current UIViewControllers view.Rog

1 Answers

1
votes

You should not be using a modal view with a tab bar as you are doing in the current context. Instead, let the HomeViewController view be full screen. To display the tab bar, go to Simulated Metrics in Interface Builder & select Tab Bar for the bottom bar. That way, your view will not be modal & will be truncated to the space between the navigation bar & the tab bar.