更改UITabBar高度 [英] Change UITabBar height

查看:93
本文介绍了更改UITabBar高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 UITabBarController 作为根视图,应用程序支持iOS 6及更高版本。项目类层次结构如下。

I use UITabBarController as a root view and app supports iOS 6 and above. Project class hierarchy is as below.

UITabBarController
  - tab1
    - UINavigationController
      - UIViewController
      - UIViewController
      .
      .
  - tab2
    - UINavigationController
      - UIViewController
      - UIViewController
      .
      .
      .
  - tab3
    - UIViewController
  - tab4
    - UIViewController

我使用下面的代码更改了其中一个UIViewControllers(位于 UINavigationController 中)的 UITabBar 的高度以上层次结构。

I used below code to change height of UITabBar in one of the UIViewControllers (which is inside UINavigationController) in above hierarchy.

CGRect tabbarFrame = self.tabBarController.tabBar.frame;
tabbarFrame.size.height += 60;
self.tabBarController.tabBar.frame = tabbarFrame;

但它没有改变高度。显示 UITabBar ,默认高度。虽然记录它的值打印更改值,如下所示。

But its not changing the height. UITabBar is displayed with default height. Though logging its value prints changed value as shown below.

<UITabBar: 0xb528f60; frame = (0 431; 320 109); autoresize = W+TM; layer = <CALayer: 0xb529080>>

如何更改 UITabBar 的高度实现这样的目标:?

How can I change UITabBar's height to achieve something like this:?

推荐答案

标签栏的高度是Apple设置的常量,因此您无法更改它。

The height of the tab bar is a constant set by Apple so you can't change it.

这篇关于更改UITabBar高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆