一、 iPhone X跳轉(zhuǎn)push到下一個(gè)界面的時(shí)候tabBar上移了
- 解決方案:
- 在UINavigationController的子類(lèi)集成父類(lèi)push方法里改變tabBar的高度
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
if (self.childViewControllers.count > 0) {
viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"v1_left_item"] style:UIBarButtonItemStyleDone target:self action:@selector(back)];
viewController.hidesBottomBarWhenPushed = YES;
}
[super pushViewController:viewController animated:YES];
CGRect frame = self.tabBarController.tabBar.frame;
frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height;
self.tabBarController.tabBar.frame = frame;
}
二、app在iPhoneX中不能全屏顯示問(wèn)題
-
上下是多余的黑條如圖:
非全屏效果 - 解決方案:
- xcode版本9以上是硬性要求,你會(huì)發(fā)現(xiàn)在啟動(dòng)圖里面多了一個(gè)位置iPhone X,@3x像素要求1125*2436,把這個(gè)圖填上就可以
- iPhone5/6/7/8都用這個(gè)的啟動(dòng)圖像素1125*2436,自動(dòng)全屏顯示,親測(cè)有效

啟動(dòng)圖

全屏顯示效果
