在UITabBarViewController界面设置spa
self.tabBar.barStyle = UIBarStyleBlack;io
在NavigationController界面设置
table
self.navigationBar.barStyle = UIBaselineAdjustmentNone;class
解决滚动视图下移64px的问题scroll
self.automaticallyAdjustsScrollViewInsets = NO;call
或top
//将导航栏的半透明效果去掉tab
self.navigationController.navigationBar.translucent = NO;di
解决UItableView上移64px的问题:view
- (void)viewWillLayoutSubviews {
if (self.view.subviews[0] != self.tableView) {
//self.tableView是咱们但愿正常显示cell的视图
self.tableView.subviews[0].frame = CGRectMake(0, 64, kScreenW, kScreenH);
}
}
/*或者设置 tableView的y : 64*/
//若是navigationbar.translucent = YES; scrollview会被自动设置contentInset.top=64
- (void)viewWillLayoutSubviews{ [super viewWillLayoutSubviews]; _tableView.contentInset = UIEdgeInsetsZero; _tableView.scrollIndicatorInsets = UIEdgeInsetsZero;}