我正在使用andorid。我想創建這樣一個佈局: -Android我應該使用哪種佈局
當我再轉動我的Android設備應該是這樣的: -
必須有這些圖像之間的一些填充。請建議我如何執行此操作。我應該爲此使用哪種類型的佈局。 我在等你的建議。你可以給我發一些與此相關的鏈接。
預先感謝您。
我正在使用andorid。我想創建這樣一個佈局: -Android我應該使用哪種佈局
當我再轉動我的Android設備應該是這樣的: -
必須有這些圖像之間的一些填充。請建議我如何執行此操作。我應該爲此使用哪種類型的佈局。 我在等你的建議。你可以給我發一些與此相關的鏈接。
預先感謝您。
您可以找到不同的佈局here
使用網格佈局或TableLayout不錯的教程,但你必須寫條件根據取向
這段代碼可以幫助你:
<TableLayout
android:id="@+id/tableLayout1"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginTop="10dip">
<TableRow android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dip">
<TextView android:id="@+id/textView1"
android:text="@string/name"
android:textColor="@color/black"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingRight="5dip"
android:layout_weight=".30"
android:width="0dip"></TextView>
<TextView android:id="@+id/name_value"
android:text="AAA"
android:textColor="@color/black"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingLeft="5dip"
android:singleLine="false"
android:layout_weight=".70"
android:width="0dip"></TextView>
</TableRow>
用這種方式,你可以控制的填充或保證金的任何DP不管你想要的。屏幕方向更改可以控制佈局。 您可以更改:
android:layout_weight=".30"
來控制每列的寬度。
這是一個工作代碼。
謝謝pankaj先生,,,謝謝大家誰試圖幫助我... – 2012-02-28 11:49:57
@Pushpendra Kuntal你最歡迎。 – 2012-02-28 12:21:00