尝试在标签栏 Controller 中制作全屏 View 。是风景。能够使用 self.tabBarController.tabBar.hidden = YES
隐藏标签栏,这会在标签栏所在的位置留下空白。
使 tabbarcontroller 的 View 全屏:
self.tabBarController.view.frame = self.view.frame = CGRectMake(0, 0, 480, 320);
[self.tabBarController.view setCenter:CGPointMake(160.0f, 240.0f)];
self.tabBarController.tabBar.hidden = YES;
self.tabBarController.view.backgroundColor = [UIColor redColor];
然后我尝试让 View Controller 也全屏显示。但它不会粘住,无法调整 view.frame
的大小。
self.view.backgroundColor = [UIColor yellowColor];
self.view.frame = CGRectMake(0, 0, 480, 320);
[self.view setCenter:CGPointMake(160.0f, 240.0f)];
有什么办法可以很好地解决这个问题吗?!
最佳答案
在推送 viewController 之前将 hidesBottomBarWhenPushed 属性设置为 YES。
关于iphone - 标签栏的隐藏显示空白(即使框架是全屏的),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6584532/