zoukankan      html  css  js  c++  java
  • iOS 导航栏遮挡问题 --- iOS开发系列 ---项目中成长的知识七

    不知大家有没有遇见过自己写的tableview被导航栏遮挡住的问题,反正我是遇见过!

    因为在ios7以后所有的UIViewController创建后默认就是full Screen的,因此如果带导航栏的应用界面中的部分控件会被导航栏覆盖掉。

    解决方案:可以使用ios7中的UIViewController新增的属性extendLayoutIncludesOpaqueBars和edgesForExtendedLayout来解决。

    extendLayoutIncludesOpaqueBars指定了当bar使用不透明图片时,视图是否延伸至bar所在区域,默认值为NO。

    edgesForExtendedLayout则是表示视图是否覆盖到四周的区域,默认是UIRectEdgeAll,即上下左右四个方向都会覆盖。

    在这里我分享几种解决方案,希望能帮助大家解决问题的

    1.

    1       //适配iOS7uinavigationbar遮挡tableView的问题
    2    self.navigationController.navigationBar.translucent = NO;

    2.

        if( ([[[UIDevice currentDevice] systemVersion] doubleValue]>=7.0)) {
            self.edgesForExtendedLayout = UIRectEdgeNone;
            self.extendedLayoutIncludesOpaqueBars = NO;
            self.modalPresentationCapturesStatusBarAppearance = NO;
        }

    3.

        if([[[UIDevice currentDevice]systemVersion]floatValue]>=7.0)
        {
            self.edgesForExtendedLayout = UIRectEdgeNone;
            self.automaticallyAdjustsScrollViewInsets = NO;
        }
  • 相关阅读:
    kafka 0.8.x producer Example(scala)
    Google V8扩展利器发布:v8-native-binding-generator
    beyond compare秘钥被禁
    STL算法之find
    十条nmap常用的扫描命令
    cgdb UTF-8乱码
    OpenWrt笔记
    openwrt hotplug
    git常用操作
    c99标准的restrict关键字
  • 原文地址:https://www.cnblogs.com/WayneLiu/p/5062055.html
Copyright © 2011-2022 走看看