文本视图应填充图像留下的空间:
[imageview 40px, aligned left][textview][imageview 40px, aligned right]
这是我的代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/indicator_code_lock_point_area_green_holo"
android:tag="heart" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="Shakespeare was a respected poet and playwright in his own day, but his reputation did not rise to its present heights until the 19th century." />
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/indicator_code_lock_point_area_green_holo"
android:tag="heart" />
</LinearLayout>
如您所见,文本占据了右侧的图像。