大佬教程收集整理的这篇文章主要介绍了混合应用开发 欢迎界面 (二),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
本文将介绍如何为混合应用加入欢迎界面,本教程将在教程一的代码上进行修改。
为混合应用加入欢迎界面可以使用Cordova SplashScreen插件。
二,在config.xml增加SplashScreen插件配置
<preference name="splashscreen" value="splash" />
2,SplashScreenDelay属性value值表示欢迎界面关闭时间
<preference name="SplashScreenDelay" value="5000" />3,完整配置:
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file diStributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License,Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wriTing,software diStributed under the License is diStributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <widget xmlns = "http://www.w3.org/ns/widgets" id = "io.cordova.HelloCordova" version = "2.0.0"> <name>Hello Cordova</name> <description> A sample Apache Cordova application that responds to the deviceready event. </description> <author href="http://cordova.io" email="dev@cordova.apache.org"> Apache Cordova Team </author> <access origin="*"/> <!-- <content src="http://mysite.com/myapp.html" /> for external pages --> <content src="index.html" /> <preference name="loglevel" value="DEBUG" /> <preference name="splashscreen" value="splash" /> <preference name="SplashScreenDelay" value="5000" /> <preference name="BACkgroundColor" value="0xFFF" /> <!--<preference name="loadUrlTimeoutValue" value="5000" /> <preference name="InAppBrowserStorageEnabled" value="true" /> <preference name="disallowOverscroll" value="true" />--> <!-- This is required for native Android hooks --> <feature name="App"> <param name="android-package" value="org.apache.cordova.App" /> </feature> <feature name="SplashScreen"> <param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" /> </feature> </widget>
三,运行效果
以上是大佬教程为你收集整理的混合应用开发 欢迎界面 (二)全部内容,希望文章能够帮你解决混合应用开发 欢迎界面 (二)所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。