Android Activity 不会填满 WVGA 屏幕

标签 android layout screen

我正在开发一个带有按钮的简单 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/

相关文章:

java - HttpURLConnection.getInputStream() 挂起并且永远不会完成

android - 刷新 Activity 时内存泄漏

java - findViewByIdlayoutinflator 无法膨胀我的布局,使用时返回 null

android - 在 ListView 中居中文本

css - 为什么 iOS 4.2 iPad 更新会破坏这个网站布局?

android - 防止其他应用程序形成捕获/记录屏幕

c - 为什么此代码将正弦曲线倒置打印

android - Android 如何决定使用哪个布局文件夹?

Android HttpClient 内存不足错误(xml 数据)

android - 手动旋转屏幕