zoukankan      html  css  js  c++  java
  • 解决iPhone 6 Plus横屏启动界面错乱的问题

    项目要求适配iPhone6和iPhone 6 Plus,后期测试的时候发现了一个奇特的Bug。因为iPhone 6 Plus有独特的横屏模式,横屏模式启动应用会造成界面错乱,下半部分变成黑色:

    error
    error

    这样的情况有几个前提:

    1. 应用单独导入了6 Plus的启动图片,也就是适配了iPhone 6 Plus。
    2. 应用支持横屏方向。
    3. 根视图为UITabBarController。
    4. 应用横屏情况下启动。

    解决办法:

    1. AppDelegate中,在didFinishLaunchingWithOptions方法中创建window前先加入:
      application.statusBarOrientation = UIInterfaceOrientationPortrait;
    2. 在rootController,viewDidAppear方法中添加:(解决旋转界面错乱)
      [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait| UIInterfaceOrientationLandscapeLeft|UIInterfaceOrientationLandscapeRight];
  • 相关阅读:
    「WC2021」表达式求值
    [补]「WC2021」括号路径
    「CEOI2020」星际迷航
    「CEOI2018」斐波那契表示法
    CF913F
    CF1017G The Tree
    NOI2020 超现实树
    LOJ 6714 Stupid Product
    LOJ 575. 不等关系
    CF1267G
  • 原文地址:https://www.cnblogs.com/huangh/p/5028965.html
Copyright © 2011-2022 走看看