我正在开发一个带有按钮的简单 LinearLayout 的 Activity 。当我在我的硬件(WVGA 480x800 屏幕)上尝试 Activity 时, Activity 仅填充标准尺寸 (480x320),而操作系统本身填充整个屏幕。
可能是什么问题。
谢谢,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#FFF" android:fitsSystemWindows="true">
<Button android:text="@+id/Button01" android:id="@+id/Button01" android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
</LinearLayout>
最佳答案
我相信您必须在 list 文件中指定您希望允许应用程序缩放到更大屏幕的尺寸。
参见:http://developer.android.com/guide/practices/screens_support.html#attrs了解更多信息。
关于<supports-screens>
的部分 list 中的属性可能包含您要查找的内容。
关于Android Activity 不会填满 WVGA 屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2510354/