iOS11 系统为UIScrollView增加一个contentInsetAdjustmentBehavior属性,默认为UIScrollViewContentInsetAdjustmentAutomatic,要想和iOS11之前显示效果一样的话,只需要写一个分类在+ (void)load方法设置一下就好了

 

#import "UIScrollView+KJExtension.h"

 

@implementation UIScrollView (KJExtension)

 

+ (void)load {

    

    NSLog(@"scrollView调用了load方法");

    

    if (@available(iOS 11.0, *)){

        [[self appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];

    }

}

@end

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2021-09-04
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案