去掉UITabBar和NavigationBar上的黑线

在UITabBarViewController界面设置

self.tabBar.barStyle = UIBarStyleBlack;

在NavigationController界面设置

self.navigationBar.barStyle = UIBaselineAdjustmentNone;

 

解决滚动视图下移64px的问题

     self.automaticallyAdjustsScrollViewInsets = NO;

//将导航栏的半透明效果去掉

    self.navigationController.navigationBar.translucent = NO;

解决UItableView上移64px的问题:

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

原文地址:https://www.cnblogs.com/tiffany-my/p/7019148.html