我正在开发一个使用phonegap的android应用程序,但是我在显示splashscreen方面遇到了挑战,我已经阅读了许多文档(phonegap documentation)和许多论坛,但是我没有找到针对此的解决方案。我可以按照哪些步骤解决此问题? 我试过的插件是“org.apache.cordova.splashscreen”如何在phonegap应用程序中使用splashscreen插件?
0
A
回答
0
使用这个。
<preference name="auto-hide-splash-screen" value="true" />
<gap:splash src="splash.png" /> // splash.png will be your splash image
如果您还有什么问题,分享您的config.xml
0
这是我的config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.myapplication.app" versionCode="10" version="1.0.0">
<name>My App</name>
<description>
My App
</description>
<author href="https://myapp.co.uk/developer" email="[email protected]">
Jasper Tech
</author>
<access origin=".*" />
<gap:plugin name="org.apache.cordova.splashscreen" version="0.2.7" />
<preference name="auto-hide-splash-screen" value="true" />
<gap:splash src="screen.png" />
<content src="index.html" />
<icon src="res/icon/icon.png" platform="android" width="124" height="124" density="mdpi" />
<preference name="android-minSdkVersion" value="5" />
<preference name="permissions" value="none" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="false" />
<icon src="icon.png" />
<application android:debuggable="false" />
<preference name="show-splash-screen-spinner" value="true" />
<allow-intent href="sms:*" />
<feature name="http://api.phonegap.com/1.0/device" />
<preference name="orientation" value="portrait" />
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
</widget>
0
你需要为每一个资源平台并将platform部分添加到您的config.xml文件中:
<platform name="android">
<icon density="ldpi" src="resources\android\icon\drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources\android\icon\drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources\android\icon\drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources\android\icon\drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources\android\icon\drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources\android\icon\drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="resources\android\splash\drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="resources\android\splash\drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="resources\android\splash\drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="resources\android\splash\drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="resources\android\splash\drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="resources\android\splash\drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="resources\android\splash\drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources\android\splash\drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources\android\splash\drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources\android\splash\drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources\android\splash\drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources\android\splash\drawable-port-xxxhdpi-screen.png" />
</platform>
做到这一点的最好办法是,我相信,通过离子CLI命令,但你之前安装它:
npm install -g ionic
通过CLI安装,你可以在根目录创建一个文件夹resources
(你的config.xml文件在那里),并把你的资源放在那里。 如果您只想构建splashscreen,只需在其中复制splash.png
文件。更多信息here。
当你做到这一点来看:
ionic resources
,它会建立你需要知道你已经配置了每个平台的资源,它会配置的config.xml文件你。
科尔多瓦闪屏插件已经被现在搬到这里,在NPM注册表,所以如果你想使用最新的一个:
cordova plugin add cordova-plugin-splashscreen
现在你可以添加使用
你的启动画面你的配置文件。
更多信息here。
相关问题
- 1. 如何在PhoneGap应用程序中集成/使用`WKWebView`插件
- 2. Phonegap应用程序启动过程中的splashscreen
- 3. 如何在phonegap应用程序中需要一个插件
- 4. 如何在phonegap应用程序中添加插件?
- 5. 在phonegap应用程序中不使用插件共享链接
- 6. iOS 6应用程序挂在splashscreen JQTouch + Phonegap
- 7. 如何添加PhoneGap插件并使用Phonegap构建应用程序
- 8. 如何在CLI生成的phonegap应用程序中使用plugman插件
- 9. 如何用自定义插件测试iPhone PhoneGap应用程序
- 10. 如何在Adobe PhoneGap中使用插件?
- 11. 如何在Xcode中使用Phonegap插件?
- 12. Phonegap - 如何在phonegap应用程序中使用webview下载文件?
- 13. 在Phonegap应用程序中使用turn.js
- 14. 如何使用PhoneGap中LocalNotifications插件的通知打开应用程序
- 15. Facebook,Twitter与PhoneGap应用程序集成,无需使用插件
- 16. 如何在基于WPF Prism的应用程序中使用.NET 4 SplashScreen?
- 17. jQuery Flexslider插件不能在Phonegap iOS应用程序中工作
- 18. 如何隐藏PhoneGap Android SplashScreen?
- 19. 如何在phonegap应用程序中使用foursqure的登录
- 20. 如何在PhoneGap Build应用程序中使用Freebase API?
- 21. 如何在phonegap应用程序中使用persistenceJS?
- 22. 如何在PhoneGap应用程序中使用SQLite数据库?
- 23. 如何在phonegap应用程序中使用外部jar?
- 24. 如何在android中使用senchatouch实现phonegap应用程序2
- 25. 如何在Cordova项目中使用PhoneGap开发应用程序
- 26. 如何在应用程序框架2.0中使用jquery插件?
- 27. 如何使用phonegap和eclipse插件为Windows或bada开发应用程序?
- 28. 如何使用剪贴板插件与phonegap构建应用程序
- 29. 如何在phonegap下载应用程序
- 30. 使用Phonegap ChildBrowser插件在Android上的应用程序PDF中查看