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;
        }
  • 相关阅读:
    android_firewall or Droidwall http://code.google.com/p/droidwall/
    CMDProcessorLibrary
    Pimp_my_Z1
    HoloGraphLibrary
    程序猿正本清源式进化的意义
    UnsatisfiedLinkError: No implementation found for , AndroidStudio使用*.so
    HUNNU-10307-最优分解问题
    Spring声明式事务
    【献给CWNU的师弟】Web篇
    迪科斯彻算法总结
  • 原文地址:https://www.cnblogs.com/WayneLiu/p/5062055.html
Copyright © 2011-2022 走看看