iOS11 界面适配 UITableView/UIScrollV

2018-02-28  本文已影响3人  SoaringHeart

新建UIApplication分类

#import "UIApplication+Helper.h"

+ (void)setupAppearance{
  //  [self setupNavigationbar];
    [self setupTableView];
    [self setupScrollview];
    
}

+ (void)setupTableView{
    if (@available(iOS 11.0, *)) {
        UITableView.appearance.estimatedRowHeight = 0.0;
        UITableView.appearance.estimatedSectionHeaderHeight = 0.0;
        UITableView.appearance.estimatedSectionFooterHeight = 0.0;

    }
}

+ (void)setupScrollview{
    if (@available(iOS 11.0, *)) {
        UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        
    }
}

然后在
- (BOOL)application: didFinishLaunchingWithOptions: {
中调用  
 [UIApplication setupAppearance];

上一篇 下一篇

猜你喜欢

热点阅读