3
顯示在下方空白處當我使用TabBarController在頂部
我在底部越來越空的空間,當我在screen.In iOS7它的頂部具有的UITabBarController使用此代碼
self.edgesForExtendedLayout=UIRectEdgeBottom;
self.extendedLayoutIncludesOpaqueBars = YES;
工作
//如果在iOS 6中得到空space.Below是我用來顯示的TabBar
appDelegate.tabBarController.tabBar.frame = CGRectMake(0, 20, 320, 50);
appDelegate.tabBarController.delegate=self;
UIView *view=[[UIView alloc]initWithFrame:CGRectMake(0, -20, 320, 600)];
viewControllers = [[NSMutableArray alloc] init];
TagViewController *view1 = [[TagViewController alloc] init];
UINavigationController *nav1=[[UINavigationController alloc]initWithRootViewController:view1];
[viewControllers addObject:nav1];
ContactsViewController *view2 = [[ContactsViewController alloc] init];
UINavigationController *nav2=[[UINavigationController alloc]initWithRootViewController:view2];
[viewControllers addObject:nav2];
MessagesViewController *view3 = [[MessagesViewController alloc] init];
UINavigationController *nav3=[[UINavigationController alloc]initWithRootViewController:view3];
[viewControllers addObject:nav3];
RewardsViewController *view4 = [[RewardsViewController alloc] init];
UINavigationController *nav4=[[UINavigationController alloc]initWithRootViewController:view4];
[viewControllers addObject:nav4];
SettingsViewController *view5 = [[SettingsViewController alloc] init];
UINavigationController *nav5=[[UINavigationController alloc]initWithRootViewController:view5];
[viewControllers addObject:nav5];
[appDelegate.tabBarController setViewControllers:viewControllers];
appDelegate.tabBarController.tabBarController.view.frame=CGRectMake(0, 0, 320, 480);
[view addSubview:appDelegate.tabBarController.view];
[self.view addSubview:view];
你在做這在界面生成器?你有可能把它拖到錯誤的地方,也許會進入桌面視圖。 – BlueSpud
我使用編碼創建了tabbar,並將表視圖放置在tabbar下方十個像素處。 – SwathiK
你可以分享你的代碼 – morroko