2016-01-27 74 views
-1

今天我为不同分辨率的Splashscreens遇到了很多麻烦。 config.xml中PhoneGap SplashScreen不起作用

我的飞溅部分:

<gap:splash src="Splash_1536x2048_Leopold_City.png" gap:platform="ios" width="1536" height="2048" /> 
<gap:splash src="Splash_2048x1536_Leopold_City.png" gap:platform="ios" width="2048" height="1536" /> 

<gap:splash src="Splash_320x480_Leopold_City.png" gap:platform="ios" width="320" height="480" /> 
<gap:splash src="Splash_480x320_Leopold_City.png" gap:platform="ios" width="480" height="320" /> 

<gap:splash src="Splash_640x960_Leopold_City.png" gap:platform="ios" width="640" height="960" /> 
<gap:splash src="Splash_960x640_Leopold_City.png" gap:platform="ios" width="960" height="640" /> 

<gap:splash src="Splash_640x1136_Leopold_City.png" gap:platform="ios" width="640" height="1136" /> 
<gap:splash src="Splash_1136x640_Leopold_City.png" gap:platform="ios" width="1136" height="640" /> 

<gap:splash src="Splash_750x1334_Leopold_City.png" gap:platform="ios" width="750" height="1334" /> 
<gap:splash src="Splash_1334x1334_Leopold_City.png" gap:platform="ios" width="1334" height="750" /> 

<gap:splash src="Splash_1242x2208_Leopold_City.png" gap:platform="ios" width="1242" height="2208" /> 
<gap:splash src="Splash_2208x1242_Leopold_City.png" gap:platform="ios" width="2208" height="1242" /> 

这些PNG文件存储在根/飞溅和RES /屏幕/ IOS,但即使我改变XML路径一些可能的文件位置图像不会加载到应用程序启动。

如果我使用:显示

<!--iPhone and iPod touch--> 
<gap:splash src="splash.png" gap:platform="ios" width="320" height="480" /> 
<gap:splash src="splash.png" gap:platform="ios" width="640" height="960" /> 

<!-- iPhone 5/iPod Touch (5th Generation) --> 
<!--<gap:splash src="[email protected]" gap:platform="ios" width="640" height="1136" />--> 
<gap:splash src="splash.png" gap:platform="ios" width="640" height="1136" /> 

<!-- iPhone 6 --> 
<!--<gap:splash src="[email protected]" gap:platform="ios" width="750" height="1334" />--> 
<gap:splash src="splash.png" gap:platform="ios" width="750" height="1334" /> 
<!--<gap:splash src="[email protected]" gap:platform="ios" width="1242" height="2208" />--> 
<gap:splash src="splash.png" gap:platform="ios" width="1242" height="2208" /> 
<!--<gap:splash src="[email protected]" gap:platform="ios" width="2208" height="1242" />--> 
<gap:splash src="splash.png" gap:platform="ios" width="2208" height="1242" /> 

<!--iPad --> 
<gap:splash src="splash.png" gap:platform="ios" width="768" height="1024" /> 
<gap:splash src="splash.png" gap:platform="ios" width="1024" height="768" /> 

<!--Retina iPad --> 
<gap:splash src="splash.png" gap:platform="ios" width="1536" height="2048" /> 
<gap:splash src="splash.png" gap:platform="ios" width="2048" height="1536" /> 

默认飞溅。但我想用不同的图像用于不同的分辨率...

请帮我:-)

+0

你使用偏好标签?你正在使用哪个插件? –

+0

偏好标签: <首选项名称= “节目-启动画面微调” 值= “假”/> <首选项名称= “闪屏” 值= “飞溅”/> <首选项名称=“自动hide-splash-screen“value =”false“/> 插件:

+0

您是否在使用PhoneGap Build? –

回答

0

请通过以下链接。可能会有帮助。

https://github.com/apache/cordova-plugin-splashscreen

+0

对不起,但这并没有帮助我...我正确使用这个插件。 –

+0

有什么要知道的命名,因为splash.png它的作品和Splash_320x200_Leopold_City.png它不是 –

+0

是的斯文。它只是名字如飞溅。请使用图片名称作为splash.png。 – Gurpinder

0

如果你建立一个使用的PhoneGap构建应用程序,应该有你的根文件夹中splash.png。尝试添加平台特定的启动画面如下。您可以更改文件名和路径。

<gap:splash src="splash.png" /> 

    <gap:splash src="res/screen/ios/screen-iphone-portrait.png" gap:platform="ios"  width="320" height="480" /> 
    <gap:splash src="res/screen/ios/screen-iphone-portrait-2x.png" gap:platform="ios"  width="640" height="960" /> 
    <gap:splash src="res/screen/ios/screen-ipad-portrait.png"   gap:platform="ios"  width="768" height="1024" /> 
    <gap:splash src="res/screen/ios/screen-ipad-portrait-2x.png"  gap:platform="ios"  width="1536" height="2048" /> 
    <gap:splash src="res/screen/ios/screen-iphone-portrait-568h-2x.png" gap:platform="ios" width="640" height="1136" /> 
    <gap:splash src="res/screen/ios/screen-ipad-landscape.png"  gap:platform="ios"  width="1024" height="768" /> 
    <gap:splash src="res/screen/ios/screen-ipad-landscape-2x.png"  gap:platform="ios"  width="2048" height="1536" /> 
    <gap:splash src="res/screen/ios/screen-iphone-landscape.png" gap:platform="ios"  width="480" height="320" /> 
    <gap:splash src="res/screen/ios/screen-iphone-landscape-2x.png" gap:platform="ios"  width="960" height="640" /> 
    <gap:splash src="res/screen/ios/[email protected]" gap:platform="ios" width="750" height="1334" /> 
    <gap:splash src="res/screen/ios/[email protected]" gap:platform="ios" width="1242" height="2208" /> 
    <gap:splash src="res/screen/ios/[email protected]" gap:platform="ios" width="2208" height="1242" /> 
+0

这就像phonegap文档,但在我的情况下不起作用...上面我添加了我的config.xml的当前版本 –

0

这是我的config.xml的当前版本。这不工作...

<gap:splash src="splash.png" /> 

<gap:splash src="Splash_1536x2048_Leopold_City.png" gap:platform="ios" width="1536" height="2048" /> 
<gap:splash src="Splash_2048x1536_Leopold_City.png" gap:platform="ios" width="2048" height="1536" /> 

<gap:splash src="Splash_320x480_Leopold_City.png" gap:platform="ios" width="320" height="480" /> 
<gap:splash src="Splash_480x320_Leopold_City.png" gap:platform="ios" width="480" height="320" /> 

<gap:splash src="Splash_640x960_Leopold_City.png" gap:platform="ios" width="640" height="960" /> 
<gap:splash src="Splash_960x640_Leopold_City.png" gap:platform="ios" width="960" height="640" /> 

<gap:splash src="Splash_640x1136_Leopold_City.png" gap:platform="ios" width="640" height="1136" /> 
<gap:splash src="Splash_1136x640_Leopold_City.png" gap:platform="ios" width="1136" height="640" /> 

<gap:splash src="Splash_750x1334_Leopold_City.png" gap:platform="ios" width="750" height="1334" /> 
<gap:splash src="Splash_1334x1334_Leopold_City.png" gap:platform="ios" width="1334" height="750" /> 

<gap:splash src="Splash_1242x2208_Leopold_City.png" gap:platform="ios" width="1242" height="2208" /> 
<gap:splash src="Splash_2208x1242_Leopold_City.png" gap:platform="ios" width="2208" height="1242" />