• 第14月第17天 automaticallyAdjustsScrollViewInsets contentInsetAdjustmentBehavior


    1.

    automaticallyAdjustsScrollViewInsets

    self.edgesForExtendedLayout = UIRectEdgeNone;

     

        if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]){

            self.automaticallyAdjustsScrollViewInsets = NO;

        }

     

     

    //如果还是有20px偏移,只能在以下方法设置了
    - (void)scrollViewDidScroll:(UIScrollView *)scrollView
    {
        if (_viewModel.pageType == 2) {
            //等级
            _tableView.contentOffset = CGPointMake(0, 0);
            return;
        }
    
        if (_tableView.contentOffset.y < 0) {
            _tableView.contentOffset = CGPointMake(0, 0);
        }

     ios11

        self.automaticallyAdjustsScrollViewInsets = NO;
        if ([_tableView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
            if (@available(iOS 11.0, *)) {
                _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
            } else {
                // Fallback on earlier versions
            }
        }

     http://www.jianshu.com/p/8440a3d181c9

    http://www.jianshu.com/p/75fd23bb5286

  • 相关阅读:
    win7 IIS配置及设置
    JS高效关键字搜索转
    CLR读书笔记第四章 类型基础
    SQL语句执行顺序
    JS常用方法转
    js 设置url参数转
    随机生成 字体大小转
    jquery获得select option的值 和对select option的操作转自(紫寒)
    前端开发者基本要求转
    2 Request对象的一些属性等
  • 原文地址:https://www.cnblogs.com/javastart/p/7849787.html
Copyright © 2020-2023  润新知