zoukankan      html  css  js  c++  java
  • iOS7新特性

    ios7.0中视图控制器中视图坐标布局问题
    if ([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0) { self.edgesForExtendedLayout=UIRectEdgeNone;//ios 7中不调整屏幕坐标位置 }


    iOS6中   self.view的坐标是从导航栏下面开始的 (0,0,320,480)
    IOS7中   self.view是屏幕左上角开始的  默认也是(0,0,320,480)填充整个屏幕
    如果你设置为
    self.edgesForExtendedLayout=UIRectEdgeNone;坐标(0,64,320,416)
    64=等于状态栏+导航栏的高度。
     
    iOS7中通过ViewController重载方法返回枚举值的方法来控制状态栏的隐藏和样式。
    首先,需要在Info.plist配置文件中,增加键:UIViewControllerBasedStatusBarAppearance,并设置为YES;
    然后,在UIViewController子类中实现以下两个方法:
    复制代码
    - (UIStatusBarStyle)preferredStatusBarStyle
    {
        return UIStatusBarStyleLightContent;//设置状态栏的颜色
    }
    - (BOOL)prefersStatusBarHidden
    {
        return NO;//是否显示状态栏 yes是隐藏,NO是显示
    }
  • 相关阅读:
    ACdream 1224 Robbers (贪心)
    HDU 4320 Arcane Numbers 1 (质因子分解)
    在脚本中重定向输入
    呈现数据
    shell中的for、while、until(二)
    shell中的for、while、until
    C 指针疑虑
    结构化命令
    fdisk -c 0 350 1000 300命令
    PC机上的COM1口和COM2口
  • 原文地址:https://www.cnblogs.com/billy-chou/p/3907795.html
Copyright © 2011-2022 走看看