美文网首页
iOS 13适配问题

iOS 13适配问题

作者: NanNan | 来源:发表于2019-09-25 16:20 被阅读0次

    问题1 屏幕下移

    点击查看此文章
    更新Xcode11以后,在iOS13系统中遇到如下问题

    借用网上图片.gif

    注意出现这种情况的原因:
    UIViewController中的属性modalPresentationStyle(该属性是控制器在模态视图中的样式)

    • 在iOS13之前默认属性是UIModalPresentationFullScreen;
    • 在iOS13默认属性是UIModalPresentationAutomatic;
      所以我们只需要手动设置modalPresentationStyle = UIModalPresentationFullScreen;
    ViewController *vc = [[ViewController alloc] init];
    vc.title = @"presentVC";
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    nav.modalPresentationStyle = UIModalPresentationFullScreen;
    [self.window.rootViewController presentViewController:nav animated:YES completion:nil];
    
    

    问题2 状态栏高度

    ios13后弃用

    [UIApplication sharedApplication].statusBarFrame.size.height;
    

    改为

     [UIApplication sharedApplication].keyWindow.windowScene.statusBarManager.statusBarFrame.size.height;
    

    问题3 网页加载

    UIWebView在iOS13弃用了改用WKWebView

    问题4 App的logo问题

    如果替换过logo,在iOS13 上点击home键,切换到后台,之前被替换的图标会一闪而过。

    问题5 暗黑模式

    如果不想自己的应用开启暗黑模式,则需要在代码的info.plist文件中配置key值,User Interface Style为Light如图:


    屏幕快照 2019-09-26 16.08.06.png

    相关文章

      网友评论

          本文标题:iOS 13适配问题

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