zoukankan      html  css  js  c++  java
  • iOS translucent automaticallyAdjustsScrollViewInsets edgesForExtendedLayout contentInsetAdjustmentBehavior

    translucent

           self.navigationController.navigationBar.translucent = NO;

           ios7 之后iOS7之后由于navigationBar.translucent默认是YES,原点在(0,0)点

           当设置NO的时候,原点坐标在(0,64)点开始,屏幕会多一个导航栏的高度

    automaticallyAdjustsScrollViewInsets

           self.automaticallyAdjustsScrollViewInsets = NO;

           self.edgesForExtendedLayout = UIRectEdgeNone;

    contentInsetAdjustmentBehavior

    iOS11中automaticallyAdjustsScrollViewInsets方法被废弃,我们需要使用UIScrollView的 contentInsetAdjustmentBehavior 属性来替代它.
    我们先来看看contentInsetAdjustmentBehavior这个枚举值:

    typedef NS_ENUM(NSInteger, UIScrollViewContentInsetAdjustmentBehavior) {
        UIScrollViewContentInsetAdjustmentAutomatic, 和scrollableAxes一样,scrollView会自动计算和适应顶部和底部的内边距并且在scrollView 不可滚动时,也会设置内边距.
        UIScrollViewContentInsetAdjustmentScrollableAxes, //自动计算内边距.
        UIScrollViewContentInsetAdjustmentNever, //不计算内边距,
        UIScrollViewContentInsetAdjustmentAlways, //根据safeAreaInsets 计算内边距
    } API_AVAILABLE(ios(11.0),tvos(11.0));

    self.navigationController.navigationBar.translucent = NO; 相当于self.automaticallyAdjustsScrollViewInsets = NO;self.edgesForExtendedLayout = UIRectEdgeNone;相当于 UIScrollViewContentInsetAdjustmentNever
  • 相关阅读:
    路面修整
    路由器安置
    高维网络
    SRETAN
    对象、数组 深度复制,支持对象嵌套数组、数组嵌套对象
    仿 window对象 confirm方法
    仿 window对象 alert 方法
    饼状图
    柱状图
    树状图
  • 原文地址:https://www.cnblogs.com/lsh1234/p/12322129.html
Copyright © 2011-2022 走看看