javascript - 如何显示 android 的启动画面? Cordova

标签 javascript css ios-simulator media-queries

这是我通过 CLI 的过程

cordova create project

-

cordova platform add android

-

i created my own res folder into the root of the project

-

then copied all the files to the respective folder and added the configuration to the config.xml that exists in the root of project: it looks like this

这是我选择每个启动画面尺寸的地方:https://github.com/phonegap/phonegap/wiki/App-Splash-Screen-Sizes

<gap:splash src="res/android/drawable-port-ldpi.png" gap:platform="android" gap:density="ldpi" gap:qualifier="port-ldpi"/>
<gap:splash src="res/android/drawable-port-mdpi.png" gap:platform="android" gap:density="mdpi"  gap:qualifier="port-mdpi"/>
<gap:splash src="res/android/drawable-port-hdpi.png" gap:platform="android" gap:density="hdpi"  gap:qualifier="port-hdpi"/>
<gap:splash src="res/android/drawable-port-xhdpi.png" gap:platform="android" gap:density="xhdpi"  gap:qualifier="port-xhdpi"/>

<gap:splash src="res/android/drawable-land-ldpi.png" gap:platform="android" gap:density="ldpi" gap:qualifier="land-ldpi"/>
<gap:splash src="res/android/drawable-land-mdpi.png" gap:platform="android" gap:density="mdpi"  gap:qualifier="land-mdpi"/>
<gap:splash src="res/android/drawable-land-hdpi.png" gap:platform="android" gap:density="hdpi"  gap:qualifier="land-hdpi"/>
<gap:splash src="res/android/drawable-land-xhdpi.png" gap:platform="android" gap:density="xhdpi"  gap:qualifier="land-xhdpi"/>

-

but still, the splashscreen doesn't show

然后我去了 phonegap 文档,找到了一些与 splashscreen 插件相关的东西。 https://github.com/apache/cordova-plugin-splashscreen#android-quirks

对我来说,不清楚应该给 foo 什么值 甚至我应该把文件放在哪里。此外,该插件没有指定它如何处理非 9patch 图像。

有人可以帮助我吗?

最佳答案

我相信你需要提供一个默认的:

<gap:splash src="splash.png" width="320" height="125" />

关于javascript - 如何显示 android 的启动画面? Cordova ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29076374/

相关文章:

css - 在输入字段上恢复 Webkit 的 CSS 大纲

ios - AVFoundation 位置音频无法在 iOS 设备上运行

javascript - 如何自动测试某些 javascript API 的一组用例?

javascript - 以跨浏览器兼容的方式触发 onresize

html - 如何考虑 :nth-child 的 child

ios - 不能同时运行 Watch 和 iPhone Simulator

ios - 退出应用程序并返回后 Xcode 不显示日志

javascript - 如何在单击时将 Prop 传递给子组件 - Vue2

javascript - 将 ARGB 转换为 RGBA 格式

css - 当标签内的输入字段处于事件状态时如何保持标签处于事件状态?