self.automaticallyAdjustsScrollViewInsets = NO;
[IQKeyboardManager sharedManager].enableAutoToolbar = NO;
[IQKeyboardManager sharedManager].enable = NO;
状态栏颜色设置
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
if (@available(iOS 13.0, *)) {
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDarkContent;
} else {
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;;
}
偏移问题
if (@available(iOS 11.0, *)) {
self.tableV.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}
self.tableV.estimatedRowHeight = 0;
self.tableV.estimatedSectionHeaderHeight = 0;
//适配ios11自适应上导航 安全区域
self.tableV.separatorStyle = UITableViewCellSeparatorStyleNone;
SEL selector = NSSelectorFromString(@"setContentInsetAdjustmentBehavior:");
if ([self respondsToSelector:selector]) {
IMP imp = [self methodForSelector:selector];
void (*func)(id, SEL, NSInteger) = (void *)imp;
func(self, selector, 2);
}
隐藏状态栏
[UIApplication sharedApplication].statusBarHidden = YES;
隐藏导航栏
[self.navigationController setNavigationBarHidden:YES animated:animated];
网友评论