【发布时间】:2011-11-24 13:02:21
【问题描述】:
我尝试将 HomeViewController 的 UIView 显示为 TabBarViewController 的模态。
我希望 UIView 显示在 TabBar 上,并且在屏幕底部有 TabBar。
虽然,将 HomeController 的 UIView 的宽度和高度设置为 320 x 320 px 并不会阻止视图显示全屏。 它覆盖了UITabBar,当应用程序启动时我在屏幕按钮上看不到UITabBar。
这是我的代码。
//在 TabBarWithHomeAppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 方法
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;
界面构建器短屏幕
在模拟器中
这是我的源代码
任何建议都很有价值。
谢谢,
【问题讨论】:
-
模式视图在 iPhone 上总是全屏显示。您需要使用 UIView 作为当前 UIViewControllers 视图的子视图。
标签: iphone ios uiview uiviewcontroller interface-builder