新建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];
网友评论