license: 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.
Displays and hides the application's splash screen.
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
<plugin name="SplashScreen" value="CDVSplashScreen" />
Copy the splash screen image into the Android project's res/drawable
directory. The size for each image should be:
You should use a 9-patch image for your splash screen.
In the onCreate
method of the class that extends DroidGap
, add the following two lines:
super.setIntegerProperty("splashscreen", R.drawable.splash); super.loadUrl(Config.getStartUrl(), 10000);
The first line sets the image to display as the splashscreen. If you name your image anything other than splash.png
, you need to modify this line. The second line is the normal super.loadUrl
line, but it has a second parameter that specifies a timeout value for the splash screen. In this example the splash screen displays for 10 seconds. To dismiss the splash screen once the app receives the deviceready
event, call the navigator.splashscreen.hide()
method.
Copy your splash screen images into the iOS project's Resources/splash
directory. Only add the images for the devices you want to support, such as iPad or iPhone. The size of each image should be: