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

问题描述

我一直试图从UITabBarController隐藏/删除UITabBar.我的iPhone版本中有一个UITabBar,但我已将导航移到了iPad版本的新视图控制器中.新菜单可使用UITabBarDelegate方法在UIViewControllers之间切换.

I'v been trying to hide/remove the UITabBar from a UITabBarController. I've got a UITabBar in my iPhone version but I've moved the navigation to a new view controller for the iPad version. The new menu works using the UITabBarDelegate methods to switch between the UIViewControllers.

到目前为止一切都很好.

So far so good.

我现在所需要的就是以某种方式隐藏UITabBar.

All I need now is to somehow hide the UITabBar.

我有一个自定义的UITabBarController,我只是尝试使用self.tabBar.hidden = YES;.但是我需要视图填充屏幕.

I've got a custom UITabBarController and I've tried simply using self.tabBar.hidden = YES;but i need the view to fill the screen.

谢谢

推荐答案

我找到了我要找的答案

希望这对其他人有帮助

for(UIView *view in self.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
        {
            [view setFrame:CGRectMake(view.frame.origin.x, self.view.frame.size.height+49, view.frame.size.width, view.frame.size.height)];
        }
        else
        {
            [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, self.view.frame.size.height)];
        }

    }

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

08-21 09:17