我将UITabBarController
用作根视图,该应用程序支持iOS 6及以上版本。项目类层次结构如下。
UITabBarController
- tab1
- UINavigationController
- UIViewController
- UIViewController
.
.
- tab2
- UINavigationController
- UIViewController
- UIViewController
.
.
.
- tab3
- UIViewController
- tab4
- UIViewController
我在上述层次结构中的一个UIViewController中使用以下代码更改UITabBar
的高度(该UIViewController位于UINavigationController
中)。
CGRect tabbarFrame = self.tabBarController.tabBar.frame;
tabbarFrame.size.height += 60;
self.tabBarController.tabBar.frame = tabbarFrame;
但它并没有改变高度。 UITabBar
显示默认高度。尽管记录其值会打印出下面显示的更改后的值。
<UITabBar: 0xb528f60; frame = (0 431; 320 109); autoresize = W+TM; layer = <CALayer: 0xb529080>>
我该如何改变UITabBar
的高度,以实现类似于这样的效果?