我正在运行AVD“Google API Level 11”(平台3.0),并且想了解为什么我的登录 活动并未占用整个屏幕的模拟器地产。我在适当的地方使用fill_parent。在景观它看起来不错,见下文android模拟器剪辑我的活动(在横向上正常)
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>
我同意@DKIT。你说“风景看起来不错”,我不同意。不知何故,宽度被指定,我会看看你的'AndroidManifest.xml'文件。 – dmon
感谢您的回复,我从头开始创建项目,所以我拥有非常基本的AndroidManifest.xml,没有提及支持屏幕。我确实注意到组件的构成如何,没有比WFM-PDA边界更宽。但我认为整个应用程序(包括顶部的边框)应该与屏幕一样宽,与信号/电池/时间状态栏一样宽。我确实将支持屏幕标签放入,但其行为相同。也许它只是模拟器,我没有平板电脑来测试,所以只想通过模拟器进行编码。 – robert
dang,我也在我的中试过android:shrinkColumns =“*”,但没有效果 –
robert