0

我正在运行 AVD“Google API Level 11”(平台 3.0)并想了解为什么我的登录活动没有占用模拟器的整个屏幕空间。我在适当的地方使用 fill_parent 。在横向看起来还可以,见下文

http://www.akersacademy.com/images/robert/landscape.png

在纵向中,模拟器有更多使用空间,但它似乎夹住了我的帮助按钮(问号图像)

http://www.akersacademy.com/images/robert/portrait.png

这是我的 login_activity.xml 文件,任何人都可以帮我解决发生的事情

<LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:orientation="vertical"
    android:layout_gravity="center_vertical">


    <ImageView  android:layout_width="fill_parent" 
                    android:src="@drawable/wfm_login_v2"                        
                    android:layout_height="wrap_content"/>

    <TableLayout            
        android:stretchColumns="1"          
        android:layout_height="wrap_content" 
        android:layout_width="fill_parent"
        android:layout_gravity="center">

        <TableRow>
            <TextView android:text="@string/loginActivityUserId"
                android:layout_height="wrap_content"
                android:layout_width="fill_parent"
                android:textSize="24sp" 
                android:gravity="right"/>

            <EditText 
                android:layout_height="wrap_content"
                android:layout_width="fill_parent" />

            <ImageButton 
                android:id="@+id/loginHelpButton"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:src="@drawable/question" />

        </TableRow>

        <TableRow>
            <TextView android:text="@string/loginActivityPassword"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:textSize="24.5sp" />

            <EditText 
                android:layout_width="fill_parent" android:layout_height="wrap_content"/>

            <ImageView 
                android:layout_height="fill_parent"
                android:layout_width="fill_parent"
                android:src="@drawable/black_32x32" />
        </TableRow>

        <TableRow>

                <TextView android:text=""
                    android:layout_height="wrap_content"
                    android:layout_width="wrap_content" />

                <LinearLayout
                    android:layout_height="wrap_content"
                    android:layout_width="fill_parent"
                    android:orientation="horizontal"
                    android:gravity="right"
                    android:weightSum="10">
                    <Button android:text="Login"
                            android:layout_height="wrap_content"
                            android:layout_width="wrap_content" 
                            android:layout_weight="5"
                            android:textSize="24.5sp"/>
                    <Button android:text="Cancel"
                            android:layout_height="wrap_content"
                            android:layout_width="wrap_content"
                            android:layout_weight="5"
                            android:textSize="24.5sp"/>
                </LinearLayout>

                <ImageView 
                    android:layout_height="fill_parent"
                    android:layout_width="fill_parent"
                    android:src="@drawable/black_32x32" />

        </TableRow>

</TableLayout>

</LinearLayout>

4

1 回答 1

1

您的组件似乎与顶部的 WFM-PDA 边框完美对齐。你确定这不是你拥有的所有屏幕空间吗?它在真实设备上的外观如何?

除此之外 - 我在这里从臀部拍摄:尝试在您的 TableLayout 上设置 android:shrinkColumns="*" ,看看它是否有帮助......

另外:检查您的 AndroidManifest.xml 文件,也许您可​​以使用支持屏幕属性做一些事情:

<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:resizeable="true"/>
于 2011-06-19T00:01:42.077 回答