自从我更新到iOS 7.1以来,无法再使用的选项卡大小调整为74像素:
[[tabBarController.view.subviews objectAtIndex:0] setFrame:CGRectMake(0, 0, 320, screenSize.height-73)];
[tabBarController.tabBar setFrame:CGRectMake(0, screenSize.height-73, 320, 74)];
此代码导致选项卡向上移动,但下面有一些空白空间。
作为任何人的解决方案?
如果你改变你的尺寸UITabBar
在viewDidLayoutSubviews
你的UITabBarController
子类,调整大小的iOS 7和7.1下工作。以我的代码为例:
- (void)viewDidLayoutSubviews
{
CGFloat tabBarHeight = 39.0;
CGRect frame = self.view.frame;
self.tabBar.frame = CGRectMake(0, frame.size.height - tabBarHeight, frame.size.width, tabBarHeight);
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句