如何让我的手机应用程序在平板电脑(Xoom)中填满整个屏幕?

时间:2011-06-17 13:09:58

标签: android android-layout tablet xoom

我尝试将我的应用程序运行到Xoom平板电脑中,结果与手机的大小完全相同(它没有填满整个屏幕)。

所以,我创建了一个非常简单的项目,它只显示一个降级图像和一个中间的进度条。我得到了相同的结果,如下图所示:

Xoom - Tiny screen http://raphaeu.com/gvt/Imagem.jpg

那么,我如何继续编写布局以填写平板电脑的整个屏幕?

这是我的清单:

<?xml version="1.0" encoding="utf-8"?>

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".MainActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

这是我的main.xml布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@drawable/splash_portrait">

<ProgressBar 
    style="?android:progressBarStyle"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true" 
    android:layout_centerInParent="true"
/>

</RelativeLayout>

这是整个项目,如果你想看看它: http://raphaeu.com/gvt/xoom.zip

非常感谢你!!

2 个答案:

答案 0 :(得分:4)

将此添加到您的清单..

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

这是细节...... http://developer.android.com/guide/practices/screens-distribution.html

答案 1 :(得分:0)

尝试调整xml布局,使用“fill_parent”表示高度和宽度。使用wrap_content告诉视图只占用所需的空间,而不是增长到适合可用的屏幕大小。

相关问题