2013-08-26 59 views
-1

如何解决屏幕分辨率问题?不同Android设备的屏幕分辨率

我想任何Android设备上我的应用程序运行,而其布局不应改变,

我阅读支持多种屏幕的Android的博客,但没有得到足够的主意。

我创建了不同的布局文件夹,如布局小,布局正常,布局大,布局xlarge,并为所有文件夹创建不同的XML文件。

但是,当我在平板电脑上运行它需要默认正常大小的XML文件,我不知道为什么?

请帮我解决这个问题,在此先感谢,并等待响应

+0

什么是您的平板电脑的分辨率和dp? –

回答

0
<supports-screens 
      android:smallScreens="true" 
      android:normalScreens="true" 
      android:largeScreens="true" 
      android:xlargeScreens="true" 
      android:anyDensity="true" /> 

一下添加到应用程序的清单文件。

0

根据this页面布局小,布局正常,布局大,布局XLARGE 已过时,您将使用

36x36 for low-density 
48x48 for medium-density 
72x72 for high-density 
96x96 for extra high-density 

为alernative,但是进一步的信息,请查询我的回答here

0

创建布局和绘制具有以下预选赛

layout-sw600dp drawable-sw600dp

这意味着平板电脑屏幕的最低600dp和更高可以使用此布局和drawable。

因此,对于标准配置限定符对屏幕尺寸可以创建以下配置:

1)布局sw480dp抽拉-sw480dp

2)布局sw600dp抽拉-sw600dp

3)于版图sw720dp绘制-sw720dp

检查http://android-developers.blogspot.in/2011_07_01_archive.html

0

继指南将只是帮你d为大多数情况提供了这个问题,但从来没有全部的情况。查看以下列表,这是Google的AOSP主屏幕源代码。即使这样也不能保证它适用于所有设备。所以你的远远不够。

drawable 
drawable-hdpi 
drawable-land-hdpi 
drawable-land-mdpi 
drawable-land-xhdpi 
drawable-mdpi 
drawable-nodpi 
drawable-sw600dp-hdpi 
drawable-sw600dp-land-hdpi 
drawable-sw600dp-land-mdpi 
drawable-sw600dp-mdpi 
drawable-sw600dp-nodpi 
drawable-sw600dp-xhdpi 
drawable-sw720dp-hdpi 
drawable-sw720dp-land-hdpi 
drawable-sw720dp-land-mdpi 
drawable-sw720dp-mdpi 
drawable-sw720dp-nodpi 
drawable-sw720dp-xhdpi 
drawable-xhdpi 
layout 
layout-land 
layout-port 
layout-sw600dp-port 
layout-sw720dp 
layout-sw720dp-port