当前位置: 首页 > 知识库问答 >
问题:

Phonegap构建应用程序在Android中不显示闪屏

景胜涝
2023-03-14

我正在为iOS和Android开发一个应用程序,我正在使用Phonegap构建来创建它。我想要显示闪屏,我有。为每个平台创建的PNG文件;在iOS中,一切都很好,但在Android中,不会出现闪屏。

我的config.xml如下所示(相关代码):

<preference name="phonegap-version" value="3.4.0" />
<preference name="orientation" value="portrait" />

<gap:plugin name="org.apache.cordova.splashscreen" version="0.2.7" />

<!-- Android -->
<gap:splash src="screen/android/screen-ldpi-port.png" gap:platform="android" gap:qualifier="ldpi" />
<gap:splash src="screen/android/screen-mdpi-port.png" gap:platform="android" gap:qualifier="mdpi" />
<gap:splash src="screen/android/screen-hdpi-port.png" gap:platform="android" gap:qualifier="hdpi" />
<gap:splash src="screen/android/screen-xhdpi-port.png" gap:platform="android" gap:qualifier="xhdpi"/>

<!-- iOS -->
<gap:splash src="screen/ios/screen-iphone-portrait.png" gap:platform="ios" width="320" height="480" />
<gap:splash src="screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios" width="640" height="960" />
<gap:splash src="screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios" width="640" height="1136" />
<gap:splash src="screen/ios/screen-ipad-portrait.png" gap:platform="ios" width="768" height="1024" />
<gap:splash src="screen/ios/screen-ipad-portrait-2x.png" gap:platform="ios" width="1536" height="2008" />

我按照Phonegap文档创建了我的闪屏,Android的大小如下:

  • 屏幕-ldpi-port.png-(320x426)
  • 屏幕-mdpi-port.png-(320x470)
  • 屏幕-hdpi-port.png-(480x640)
  • 屏幕-xhdpi-port.png-(720x960)

有什么解决的办法吗?谢了!

共有1个答案

呼延化
2023-03-14

您没有默认的splash标记

<gap:splash src="splash.png" />

它在文档中:http://docs.phonegap.com/phonegap-build/configuring/icons-and-splash/

您需要查看PhoneGap构建文档,而不仅仅是PhoneGap文档。构建是特别的。

 类似资料:
  • 我在升级PhoneGap 1时遇到了很多问题。x app到Phonegap 3.0,至少对于Android来说是这样(我甚至还没有开始升级iOS版本)。我想如果我把所有这些东西都放在一个Q里,可能会对很多人有所帮助 所以问题是:当升级现有应用到Phonegap 3.0时,你需要注意什么? 这是一本顶级手册,深入介绍了一些细节。我正在描述Mac用户的过程,但尽管命令和工具可能不同,但Windows的

  • 我创建了一个phonegap项目,并通过以下方式添加了android平台http://docs.phonegap.com/en/4.0.0/guide_cli_index.md.html#The此文档的命令行界面。当我尝试使用以下命令构建它时: cordova build或cordova build android 我得到了这个错误。

  • 我是新开发人员。创建生成android APK时发现错误。 已经设置到环境变量,但什么都没发生...请帮帮我。给我这个的解决方案。 D:\Ionic\testPushNotification

  • 使用PhoneGap构建程序构建iOS和Android(无MAC) 有两种方法将Cordova/PhoneGap合并到你的应用中,你可以通过命令行来使用本地安装版,或者使用PhoneGap Build云服务。 选择很简单: 如果你有一台Mac:在本地使用Cordova 如果你不是构建iOS应用:在本地使用Cordova 如果你没有Mac但是想要创建iOS应用:使用PhoneGap Build Ph

  • 我最近开始使用Android Studio。我正在通过教程学习,我制作了一个下载原始数据的flicker应用程序的一部分。当我每次尝试运行它时,我都会在“消息”选项卡中看到这个错误: 错误:配置项目': app'时发生问题。无法解析配置': app:_debugCompile'的所有依赖项。找不到com.android.support: appcomat-v7:22的任何匹配项。因为com.and

  • 我很难同时运行我的广告和应用程序。我花了两天的时间试图找到一个解决方案,但什么都没用。请帮忙。 这段代码显示我的google play services Admob广告——广告显示,但我看不到我的游戏屏幕,它是黑色背景。 此代码(注释掉的广告代码)成功运行我的游戏。是什么原因导致这两种方法无法协同工作? 你好,威廉。我刚刚开始学习Java,我使用的教程已经开始了http://www.kilobol