如何添加单独的纵向和横向飞溅图片到Android config.xml差距:飞溅 [英] How to add separate Portrait and Landscape splash Images to Android config.xml gap:splash

查看:130
本文介绍了如何添加单独的纵向和横向飞溅图片到Android config.xml差距:飞溅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的问题是如何允许在PhoneGap中单独(横向和纵向)的图像。

The question here is how to allow for separate (landscape and portrait) splash images in PhoneGap.

推荐答案

一个令人满意的答案长时间,我终于花了几个小时搞砸它,并能够得到它工作在以下方式:定义两个项目为每个android大小 - 在肖像文件,请不要把宽度和高度属性,并在景观上放置它们。

Unable to find a satisfactory answer for a long time, I finally spent a few hours messing with it and was able to get it to work in the following way: define two items for each android size- on the portrait files, DON'T put width and height attributes, and on the landscape DO put them.

这里是我的代码,所以其他人可以遵循:

Here is my code so others can follow:

:下面的代码适用于电话GAP BUILD VERSIONS 2.7到3.0。对于新版本,请参阅 http://stackoverflow.com/a/24002601/700111 http://docs.phonegap.com/en/3.5.0/ config_ref_images.md.html#Icons%20 and%20Splash%20Screens

THE CODE BELOW IS FOR PHONE GAP BUILD VERSIONS 2.7 THROUGH 3.0. FOR NEWER VERSIONS, SEE http://stackoverflow.com/a/24002601/700111 AND http://docs.phonegap.com/en/3.5.0/config_ref_images.md.html#Icons%20and%20Splash%20Screens.

这个没有工作 - 当我有肖像文件的宽度和高度:




THIS DID NOT WORK - when i had width and height on the portrait files:

<gap:splash src="res/screen/android/screen-xhdpi-n7-landscape.png" gap:platform="android" gap:density="xhdpi" width="1280" height="800" />
<gap:splash src="res/screen/android/screen-xhdpi-landscape.png" gap:platform="android" gap:density="xhdpi" width="1280" height="720" />
<gap:splash src="res/screen/android/screen-hdpi-landscape.png"  gap:platform="android" gap:density="hdpi" width="800" height="480" />
<gap:splash src="res/screen/android/screen-mdpi-landscape.png"  gap:platform="android" gap:density="mdpi" width="480" height="320" />
<gap:splash src="res/screen/android/screen-ldpi-landscape.png"  gap:platform="android" gap:density="ldpi" width="320" height="200" />

这是工作代码

 <gap:splash src="res/screen/android/screen-xhdpi-portrait.png" gap:platform="android" gap:density="xhdpi"/>
<gap:splash src="res/screen/android/screen-xhdpi-n7-portrait.png" gap:platform="android" gap:density="xhdpi"/>
<gap:splash src="res/screen/android/screen-hdpi-portrait.png"  gap:platform="android" gap:density="hdpi"/>
<gap:splash src="res/screen/android/screen-mdpi-portrait.png"  gap:platform="android" gap:density="mdpi"/>
<gap:splash src="res/screen/android/screen-ldpi-portrait.png"  gap:platform="android" gap:density="ldpi"/>

<gap:splash src="res/screen/android/screen-xhdpi-n7-landscape.png" gap:platform="android" gap:density="xhdpi" width="1280" height="800" />
<gap:splash src="res/screen/android/screen-xhdpi-landscape.png" gap:platform="android" gap:density="xhdpi" width="1280" height="720" />
<gap:splash src="res/screen/android/screen-hdpi-landscape.png"  gap:platform="android" gap:density="hdpi" width="800" height="480" />
<gap:splash src="res/screen/android/screen-mdpi-landscape.png"  gap:platform="android" gap:density="mdpi" width="480" height="320" />
<gap:splash src="res/screen/android/screen-ldpi-landscape.png"  gap:platform="android" gap:density="ldpi" width="320" height="200" />

我可以使用此代码拥有不同的横向和纵向文件。

I was able to have different landscape and portrait files using this code.

希望这有助于某人!

- techdude

--techdude

这篇关于如何添加单独的纵向和横向飞溅图片到Android config.xml差距:飞溅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆