我正在運行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