zoukankan      html  css  js  c++  java
  • 隐藏TabBar

    方法一:将设置显示试图的高度

    - (void)makeTabBarHidden:(BOOL)hide
    {
        if ( [self.tabBarController.view.subviews count] < 2 )
        {
            return;
        }
        UIView *contentView;
        
        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
        {
            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
        }
        else
        {
            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
        }
        //    [UIView beginAnimations:@"TabbarHide" context:nil];
        if ( hide )
        {
            contentView.frame = self.tabBarController.view.bounds;        
        }
        else
        {
            contentView.frame = CGRectMake(self.tabBarController.view.bounds.origin.x,
                                           self.tabBarController.view.bounds.origin.y,
                                           self.tabBarController.view.bounds.size.width,
                                           self.tabBarController.view.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
        }
        
        self.tabBarController.tabBar.hidden = hide;

    }

    方法二:navigationController +tabBarController的结构的话,在push到下一级的childController的时候用
    childController.hidesBottomBarWhenPushed = YES;

    detailViewController *detailView=[[detailViewController alloc] initwithDic:dic];
        detailView.hidesBottomBarWhenPushed = YES;

        [self.navigationController pushViewController:detailView animated:YES]; 

  • 相关阅读:
    asp.net点击按钮下载图片而不是打开图片
    在事务中调用WebService一定程度上实现数据同步
    C#自定义Attribute的定义和获取简例
    开发ASP.NET下的MP3小偷程序
    Ajax 中XmlHttp 乱码 的解决方法 (UTF8,GB2312 编码 解码)
    MasterPage 类
    怎样成为优秀的软件测试员
    标准日本语动词大全
    什么是WSDL?
    ASP.NET程序中常用的三十三种代码
  • 原文地址:https://www.cnblogs.com/bandy/p/2395399.html
Copyright © 2011-2022 走看看