开发者

UIView alway show full screen in simulator although setting width and height to 320 x 320 px by Interface Builder

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.fra开发者_开发百科me = CGRectMake(0, 0, 320, 320);

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

return YES;

UIView alway show full screen in simulator although setting width and height to 320 x 320 px by Interface Builder

Interface builder short screen

in Simulator

UIView alway show full screen in simulator although setting width and height to 320 x 320 px by Interface Builder

and this is my source code

link to download source code

Any suggestion is valuable.

Thanks,


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜