使用 cordova splashscreen 插件构建的 Phonegap 未显示我的自定义启动图形
Phonegap build with cordova splashscreen plugin not showing my custom splash graphic
"custom splash graphic" 我只是指我自己的形象。无论我尝试什么,它总是只显示小 phonegap 机器人。请注意,我在这里只关心 Android 。这是我所做的:
- 通过命令行安装插件
- 运行 我的原始图像通过 this converter 得到它作为适当 Android 尺寸的集合
将这些路径中的文件替换为我自己的(是的,我将自己的文件重命名为这些名称):
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/ldpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/mdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/hdpi.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/xhdpi.png" />
将这些路径中的文件替换为我自己的文件,即使它与初始图像没有任何关系:
<icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/ldpi.png" />
<icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/mdpi.png" />
<icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/hdpi.png" />
<icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/xhdpi.png" />
在这一点上,老实说,我什至没有看到默认的 phonegap 机器人图像文件可能隐藏在我的项目中的什么地方,或者 config.xml 中的什么指向它。
你有没有像这样添加默认启动画面位置
<preference name="SplashScreen" value="screen"/>
也根据此处看到的新更新文档 http://docs.build.phonegap.com/en_US/configuring_icons_and_splash.md.html#Icons%20and%20Splash%20Screens
gap:splash 已弃用,您应该只使用 splash 标签
我发现如果你在 phonegap build 中使用 npm 添加插件它不起作用,所以以下将不起作用
<plugin name="cordova-plugin-splashscreen" source="npm"/>
因此您以旧方式添加了插件,因此后续工作正常
<plugin name="br.com.paveisitemas.splashscreen" spec="2.1.1" source="pgb" />
Please note that in the past splash screens were specified with the gap:splash element and the platform specified with gap:platform. This is still supported but we recommend moving to splash and platform.
在我的例子中,我看到的实际上不是启动画面,而是 index.css 中设置的背景图像。因此,当应用程序显示它加载机器人图像时...这不是启动画面。
"custom splash graphic" 我只是指我自己的形象。无论我尝试什么,它总是只显示小 phonegap 机器人。请注意,我在这里只关心 Android 。这是我所做的:
- 通过命令行安装插件
- 运行 我的原始图像通过 this converter 得到它作为适当 Android 尺寸的集合
将这些路径中的文件替换为我自己的(是的,我将自己的文件重命名为这些名称):
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/ldpi.png" /> <gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/mdpi.png" /> <gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/hdpi.png" /> <gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/xhdpi.png" />
将这些路径中的文件替换为我自己的文件,即使它与初始图像没有任何关系:
<icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/ldpi.png" /> <icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/mdpi.png" /> <icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/hdpi.png" /> <icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/xhdpi.png" />
在这一点上,老实说,我什至没有看到默认的 phonegap 机器人图像文件可能隐藏在我的项目中的什么地方,或者 config.xml 中的什么指向它。
你有没有像这样添加默认启动画面位置
<preference name="SplashScreen" value="screen"/>
也根据此处看到的新更新文档 http://docs.build.phonegap.com/en_US/configuring_icons_and_splash.md.html#Icons%20and%20Splash%20Screens
gap:splash 已弃用,您应该只使用 splash 标签
我发现如果你在 phonegap build 中使用 npm 添加插件它不起作用,所以以下将不起作用
<plugin name="cordova-plugin-splashscreen" source="npm"/>
因此您以旧方式添加了插件,因此后续工作正常
<plugin name="br.com.paveisitemas.splashscreen" spec="2.1.1" source="pgb" />
Please note that in the past splash screens were specified with the gap:splash element and the platform specified with gap:platform. This is still supported but we recommend moving to splash and platform.
在我的例子中,我看到的实际上不是启动画面,而是 index.css 中设置的背景图像。因此,当应用程序显示它加载机器人图像时...这不是启动画面。