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]; 

  • 相关阅读:
    hadoop-2.7.3安装kafka_2.11-2.1.0
    HBase数据快速导入之ImportTsv&Bulkload
    hbase shell 基本操作
    SQLplus命令中删除键和翻页键不能用的问题
    SQL*Loader 的使用sqlldr和sqluldr2方法详解
    python连接oracle导出数据文件
    python零碎知识点一
    用Python输出一个Fibonacci数列
    问题总结——window平台下gruntower安装后无法运行的问题
    JavaScript学习笔记——浅拷贝、深拷贝
  • 原文地址:https://www.cnblogs.com/bandy/p/2395399.html
Copyright © 2011-2022 走看看