我的应用程序中有两个ImageView
,一个TextView
和一个Gallery
,并希望我的布局如下所示。
............................................-.
<ImageView>| <TextView> |<ImageView>|
..............................................
| |
| Gallery |
| |
|............................................|
我有一个表格布局,几乎得到了如上所示的设计,除了当文本长度很小时ImageView
,屏幕右端的位置会继续移动。无论文本大小如何,我都希望ImageView
屏幕左端和右端的 ' 被固定。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TableRow>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/imageL"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:minHeight="30px"
android:minWidth="30px" />
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:paddingLeft="10px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="3"
android:layout_gravity="center"
android:minHeight="30px"
android:minWidth="30px" />
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/imageR"
android:paddingLeft="10px"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:minHeight="30px"
android:minWidth="30px" />
</TableRow>
</TableLayout>
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>