zoukankan      html  css  js  c++  java
  • iOS学习笔记

    一、隐藏状态栏

    -(BOOL)prefersStatusBarHidden{
        return YES;
    }

     二、在有navigation下的公共视图在添加按钮等控件的时候就不会偏移64

    self.automaticallyAdjustsScrollViewInsets = NO;

     三、隐藏tabBar的方法

    //1.设置self.tabBarController.tabBar.hidden=YES;
         
    self.tabBarController.tabBar.hidden=YES;
     
    //2.如果在push跳转时需要隐藏tabBar,设置self.hidesBottomBarWhenPushed=YES;
     
        self.hidesBottomBarWhenPushed=YES;
        NextViewController *next=[[NextViewController alloc]init];
        [self.navigationController pushViewController:next animated:YES];
        self.hidesBottomBarWhenPushed=NO;
     
    //并在push后设置self.hidesBottomBarWhenPushed=NO;
    //这样back回来的时候,tabBar会恢复正常显示。

    四、判断字典某个元素是否为空

    [dict[@"name"] isKindOfClass:[NSNull class]];

    五、添加导航栏

    ViewController * mainVC = [[ViewController alloc] init];
    UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:mainVC];
    self.window.rootViewController = nav;

    六、UIView添加背景颜色

    UIColor *bgColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"bg.jpg"]];
    self.view.backgroundColor = bgColor;
  • 相关阅读:
    抽象类存在的意义
    抽象类的特征
    抽象类的使用
    抽象类的概述
    引用类型作为方法参数和返回值
    继承的特点
    目前Java水平以及理解自我反思---01
    继承后- 构造器的特点
    指针函数
    C数组灵活多变的访问形式
  • 原文地址:https://www.cnblogs.com/xsphehe/p/5622415.html
Copyright © 2011-2022 走看看