在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;}