3

enter image description here

I am getting empty space at the bottom, when i have UITabBarController at top of the screen.In iOS7 it is working using this code

       self.edgesForExtendedLayout=UIRectEdgeBottom;
    self.extendedLayoutIncludesOpaqueBars = YES;

//Where as in ios 6 getting empty space.Below is the code i have used to show 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];
4

1 回答 1

0

在您的 viewWillAppear 中尝试此代码:

self.tabBarController.tabBar.hidden = YES;

或者

[self.tabBarController.tabBar setHidden:YES];
于 2013-10-15T13:32:20.070 回答