iOS navigationBar与tabBar的translucent

在Appdelegate里面,设置全局的Tabbar样式

    //去掉tabbar的透明度 -- 解决tabbar偏移问题

    [[UITabBar appearance] setTranslucent:NO];

 
 

navigationBar
当 translucent = YES (默认值) 时,UIViewController 中 self.view 的原点是(0,0)

当 translucent = NO 时,UIViewController 中 self.view 的原点是 (0,CGRectGetMaxY(self.navigationController.navigationBar.frame))

tabBar
当 translucent = YES (默认值) 时,UIViewController 中 self.view 的底部会被 tabBar 遮挡

当 translucent = NO 时,UIViewController 中 self.view 的底部不会被 tabBar 遮挡,也就是:

CGRectGetMaxY(self.view.frame) == CGRectGetMinY(self.tabBarController.tabBar.frame);

当 设置tabBar的backgroundImage,shadowImage 时,也相当于 translucent = NO

原文:https://blog.csdn.net/xjh093/article/details/81486569 

原文地址:https://www.cnblogs.com/qingzZ/p/10898124.html