美文网首页
iOS11 界面适配 UITableView/UIScrollV

iOS11 界面适配 UITableView/UIScrollV

作者: SoaringHeart | 来源:发表于2018-02-28 17:36 被阅读3次

新建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];

相关文章

网友评论

      本文标题:iOS11 界面适配 UITableView/UIScrollV

      本文链接:https://www.haomeiwen.com/subject/fwjixftx.html