iPhone X设配问题总结一

一、 iPhone X跳转push到下一个界面的时候tabBar上移了

  • 解决方案:
  • 在UINavigationController的子类集成父类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中不能全屏显示问题

  • 上下是多余的黑条如图:


    非全屏效果
  • 解决方案:
  • xcode版本9以上是硬性要求,你会发现在启动图里面多了一个位置iPhone X,@3x像素要求1125*2436,把这个图填上就可以
  • iPhone5/6/7/8都用这个的启动图像素1125*2436,自动全屏显示,亲测有效
启动图
全屏显示效果
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容