I put the ImageView and TextView in a RelativeLayout , which is used as list items, and I want the ImageView grow vertically with the line number of the TextView . Derived from ImageView is a png image of a vertical bar.
With the following layout, I thought that it looks great in the Layout view in Eclipse, the ImageView does not fill the height of the RelativeView at runtime. Instead, it always retains the original image height.
<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>
Why doesn't this work as I expect (or as shown in the Layout Layout view)?
source share