UIScrollView初始位置变化的问题

2018-06-14 15:33:29 浏览数 (1)

苹果爸爸iOS11废弃了UIViewController的automaticallyAdjustsScrollViewInsets属性导致

处理方案: 统一在appDelegate的didFinishLaunchingWithOptions的最开始增加:

代码语言:javascript复制
    Swift: if#available(iOS 11.0, *) {UIScrollView.appearance().contentInsetAdjustmentBehavior=.never}


    OC:    if (@available(iOS 11.0, *)) {UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;}

0 人点赞