• 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
  • 相关阅读:
    php 随机红包算法
    mysql window系统备份远程数据库到本地
    程序员 面试题【前端,java,php】
    PDMan 数据库建模工具
    数据结构之更多字符串的内容
    数据结构之参考-对象与参考
    数据结构之序列
    excel的宏与VBA入门——代码调试
    DataWorks使用小结(二)——功能面板使用指南
    DataWorks使用小结(一)——概述
  • 原文地址:https://www.cnblogs.com/lsh1234/p/12322129.html
Copyright © 2020-2023  润新知