我有在TableLayout(TableRow)中居中映像的問題。 ImageView總是在左側,我需要將他置於中心位置。在TableRow中心對齊ImageView
這裏是XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fff2d8">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/logo"
android:id="@+id/imageView"
/>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_margin="10dp"
android:layout_weight="1">
<TableRow
.
.
有版面圖:screenshot
我怎樣才能做到這一點?非常感謝您的幫助。
問候,切赫
太棒了,這就解決了我的問題!謝謝... – Jodynek