我将 aImageView和 aTextView放在RelativeLayout用作列表项的 a 中,并希望ImageView随 . 的行号垂直增长TextView。的drawable是竖条ImageView的png图片。
使用以下布局,认为它在 Eclipse 的 Layout 视图中看起来不错,ImageView但不会填充RelativeView运行时的高度。相反,它始终保持原始图片的高度。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:src="@drawable/vbar"
android:adjustViewBounds="false"
android:scaleType="fitXY"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="false"
android:layout_toRightOf="@id/iv"
android:layout_alignParentBottom="true" />
</RelativeLayout>
为什么它不像我预期的那样工作(或如 Eclipse 布局视图中所示)?