我UITabBarController
用作root视图,app支持iOS 6及更高版本.项目类层次结构如下.
UITabBarController
- tab1
- UINavigationController
- UIViewController
- UIViewController
.
.
- tab2
- UINavigationController
- UIViewController
- UIViewController
.
.
.
- tab3
- UIViewController
- tab4
- UIViewController
Run Code Online (Sandbox Code Playgroud)
我使用下面的代码来改变上面层次结构UITabBar
中的一个UIViewControllers(在里面UINavigationController
)的高度.
CGRect tabbarFrame = self.tabBarController.tabBar.frame;
tabbarFrame.size.height += 60;
self.tabBarController.tabBar.frame = tabbarFrame;
Run Code Online (Sandbox Code Playgroud)
但它没有改变高度.UITabBar
以默认高度显示.虽然记录其值打印更改值,如下所示.
<UITabBar: 0xb528f60; frame = (0 431; 320 109); autoresize = W+TM; layer = <CALayer: 0xb529080>>
Run Code Online (Sandbox Code Playgroud)
我怎样才能改变UITabBar
高度来达到这样的目的:?
我构建了一个app Demo,使用hidesBottomBarWhenPushed在Push Animation中隐藏Tabbar.
但是,当我点击跳转按钮标签栏向上移动!?像这样:
ios ×4
iphone-x ×3
swift ×2
uitabbar ×2
height ×1
ios11 ×1
iphone ×1
objective-c ×1
uistoryboard ×1
xcode ×1