android 对超大屏幕尺寸的支持
2010-08-04 09:18
295 查看
最近碰到一个问题,就是在获取超大屏幕尺寸的时候,android API返回的尺寸是错误的,获取尺寸的代码确定是没问题的,但是每次返回的结果都是错误的。
这个问题让人百思不得其解。然后就查找相关文档,终于在android docs中发现一篇关于android 屏幕支持的文章,从中我得到了答案和解决方法。
大家可以在android sdk目录下面找到这篇文章 docs/guide/practices/screens_support.html#defaults
android 有一张标准屏幕对照表,由于我的是超大屏幕,屏幕的密度,尺寸都超过了这张标准对照表中的数据。所以其不能正常工作。
表格如下,详细内容可以参阅这篇文档。
The range of screens supported by Android and the generalized screen
configurations that the platform maps them to are shown in the table below.
Table
1.
Summary of device screens supported by Android.
解决方法就是:
在AndroidManifest.xml中添加一个元素节点
如下
<manifest
xmlns:android
=
"http://schemas.android.com/apk/res/android"
>
<supports-screens
android:largeScreens
=
"true"
android:normalScreens
=
"true"
android:smallScreens
=
"true"
android:resizable
=
"true"
android:anyDensity
=
"true"
/>
</manifest>
这段的意思就是 可以支持小,中,大,以及各密度的屏幕。
然后就可以正常取得屏幕尺寸了。
这个问题让人百思不得其解。然后就查找相关文档,终于在android docs中发现一篇关于android 屏幕支持的文章,从中我得到了答案和解决方法。
大家可以在android sdk目录下面找到这篇文章 docs/guide/practices/screens_support.html#defaults
android 有一张标准屏幕对照表,由于我的是超大屏幕,屏幕的密度,尺寸都超过了这张标准对照表中的数据。所以其不能正常工作。
表格如下,详细内容可以参阅这篇文档。
The range of screens supported by Android and the generalized screen
configurations that the platform maps them to are shown in the table below.
Low density (120), ldpi | Medium density (160), mdpi | High density (240), hdpi | |
Small screen | QVGA (240x320), 2.6"-3.0" diagonal | ||
Normal screen | WQVGA (240x400), 3.2"-3.5" diagonal FWQVGA (240x432), 3.5"-3.8" diagonal | HVGA (320x480), 3.0"-3.5" diagonal | WVGA (480x800), 3.3"-4.0" diagonal FWVGA (480x854), 3.5"-4.0" diagonal |
Large screen | WVGA (480x800), 4.8"-5.5" diagonal FWVGA (480x854), 5.0"-5.8" diagonal |
1.
Summary of device screens supported by Android.
解决方法就是:
在AndroidManifest.xml中添加一个元素节点
如下
<manifest
xmlns:android
=
"http://schemas.android.com/apk/res/android"
>
<supports-screens
android:largeScreens
=
"true"
android:normalScreens
=
"true"
android:smallScreens
=
"true"
android:resizable
=
"true"
android:anyDensity
=
"true"
/>
</manifest>
这段的意思就是 可以支持小,中,大,以及各密度的屏幕。
然后就可以正常取得屏幕尺寸了。
相关文章推荐
- Android应用如何支持屏幕多尺寸多分辨率问题
- android 布局如何支持多种不同屏幕尺寸
- Android 针对多种屏幕进行设计 (一)支持各种屏幕尺寸
- Android针对多种屏幕进行设计(一)支持各种屏幕尺寸
- Android学习 - Android应用如何支持屏幕多尺寸多分辨率问题
- Android应用如何支持屏幕多尺寸多分辨率问题
- Android分辨率、密度与多屏幕尺寸支持
- Android应用如何支持屏幕多尺寸多分辨率问题
- Android应用如何支持屏幕多尺寸多分辨率问题
- Android应用如何支持屏幕多尺寸多分辨率问题
- Android应用如何支持屏幕多尺寸多分辨率问题
- Android应用如何支持屏幕多尺寸多分辨率问题
- 创建支持多种屏幕尺寸的Android应用
- 创办支持多种屏幕尺寸的Android应用
- Android应用如何支持屏幕多尺寸多分辨率问题
- 如何创建支持不同屏幕尺寸的Android应用
- android 布局如何支持多种不同屏幕尺寸
- Android应用如何支持屏幕多尺寸多分辨率问题
- Android应用如何支持屏幕多尺寸多分辨率问题
- 【eoe教程】创建支持多种屏幕尺寸的Android应用