我对你的代码做了一些更改。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:singleLine="false"
android:text="@string/text" />
<ImageView
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_above="@id/tv"
android:adjustViewBounds="false"
android:scaleType="fitXY" />
</RelativeLayout>
现在它给出了适当的输出。
我所做的是,首先声明textview并将其与父视图底部对齐。然后声明imageview并将其放在textview的顶部。因此,imageview将从textview的正上方开始,并获取所有剩余高度。我也测试了多行文本视图。希望能有帮助。