iOS iPhoneX 适配

1.导航栏高度 88 非非IPoneX手机为64

2.状态栏高度44 非IPoneX手机为20

3.tabar高度83 非IPhoneX手机为49  如下图所示;

iOS iPhoneX 适配

问题:push时tabbar向上移动导致一块小黑屏幕

简单描述一下,这就是一个苹果官方开发人员的一个打脸bug,直接上代码 如下;

在你的基类导航控制器跳转代理方法中加上这个方法即可;

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {

[super pushViewController:viewController animated:animated];

// 修改tabBra的frame

CGRect frame = self.tabBarController.tabBar.frame;

frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height;

self.tabBarController.tabBar.frame = frame;

}