self.tabBarController = [[[UITabBarController alloc] init] autorelease];
//自定义tabBarController高度
self.tabBarController.tabBar.frame = CGRectMake(0, self.window.frame.size.height-44, 320, 44);
UIView * transitionView = [[self.tabBarController.view subviews] objectAtIndex:0];
//transitionView.frame.size.height = 416;
//更改主VIEW高度,防止出现缝隙
[transitionView setFrame:CGRectMake(0, 0, 320, 436)];
self.tabBarController.viewControllers = @[viewController1, viewController2,viewController3, viewController4,viewController5];
self.window.rootViewController = self.tabBarController;
//自定义tabBarController高度
self.tabBarController.tabBar.frame = CGRectMake(0, self.window.frame.size.height-44, 320, 44);
UIView * transitionView = [[self.tabBarController.view subviews] objectAtIndex:0];
//transitionView.frame.size.height = 416;
//更改主VIEW高度,防止出现缝隙
[transitionView setFrame:CGRectMake(0, 0, 320, 436)];
self.tabBarController.viewControllers = @[viewController1, viewController2,viewController3, viewController4,viewController5];
self.window.rootViewController = self.tabBarController;
本文介绍如何使用Objective-C自定义UITabBarController的高度,并调整主视图的高度以避免显示间隙,同时设置五个不同的视图控制器。
974

被折叠的 条评论
为什么被折叠?



