【问题标题】:iOS / Cordova app splash screen shifting after loadiOS / Cordova 应用程序启动画面在加载后移动
【发布时间】:2012-11-30 17:39:14
【问题描述】:

我在使用 Cordova 2.2.0 时遇到了一些困难。

我目前已将 AutoHideSplashScreen 设置为“否”。应用程序加载完成后,启动画面向上移动 10 像素,直到我运行 navigator.splashscreen.hide(); 以真正摆脱启动画面。在它向上移动 10px 后,应用程序内容在剩下的 10px 空间中可见。

因为这只会在应用程序加载后发生,所以当我将 AutoHideSplashScreen 设置为“YES”时,10px 移位不会发生。但是,我需要能够自己隐藏启动画面。

这只发生在 3.5 英寸的 iOS 设备上。在 4 英寸的设备上,启动画面表现正常。

有什么建议吗?在我看来,问题与 CDVViewController.m 中的 self.imageView.center 有关,但我不确定如何解决。

【问题讨论】:

    标签: ios cordova


    【解决方案1】:

    我已经通过更新 CDVViewController.m 解决了这个问题:

    上一个:

    Line 695: } else { // not iPad
    Line 696:     orientedLaunchImageFile = launchImageFile;
    Line 697: }
    

    新:

    Line 695: } else { // not iPad
    Line 696:     orientedLaunchImageFile = launchImageFile;
    Line 697:     center.y += MIN(statusBarFrame.size.width, statusBarFrame.size.height) / 2;
    Line 698: }
    

    【讨论】:

    • 我在 CDVViewController.m 中找不到这一行
    【解决方案2】:

    将“查看基于控制器的状态栏外观”添加到项目 .plist 文件并设置为“否”

    这阻止了启动画面在 hide() 之前向上移动。

    【讨论】:

      猜你喜欢
      • 2020-06-08
      • 1970-01-01
      • 1970-01-01
      • 2012-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-06
      • 2011-10-25
      相关资源
      最近更新 更多