导航条透明,ios11系统,会出现偏移64的问题
在当前页面加入下面方法 - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; //去掉导航栏底部的黑线 self.navigationController.navigationBar.shadowImage = [UIImage new]; } 如果仅设置当前页导航透明,需加入下面方法 - (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; [self.navigationController.navigationBar setShadowImage:nil]; }
//iOS11,偏移64问题
if (@available(iOS 11.0, *)) {
self.circleTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
self.automaticallyAdjustsScrollViewInsets = NO;
}