美文网首页ios专题iOS开发kafka
iPhone X设配问题总结一

iPhone X设配问题总结一

作者: HeavenWong | 来源:发表于2017-10-14 19:45 被阅读35次

一、 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,自动全屏显示,亲测有效
启动图 全屏显示效果

相关文章

网友评论

    本文标题:iPhone X设配问题总结一

    本文链接:https://www.haomeiwen.com/subject/cfqfuxtx.html