Tôi có một số RelativeLayout
với một số ImageView
ở bên trái và sau đó là TextView
ở bên phải. Các TextView
được tải xuống từ một trang web thông qua API của họ để nội dung của nó sẽ khác nhau mỗi lần.Định vị chế độ xem dưới hai chế độ xem (hoặc chế độ xem thấp nhất)
Tôi muốn có một số khác TextView
bên dưới hai nhưng tôi gặp sự cố khi độ dài TextView
nhỏ hơn ImageView
. Khi điều này xảy ra, số TextView
ở dưới cùng sẽ chồng lên ImageView
vì tôi căn chỉnh phía dưới TextView
để ở bên dưới TextView
ở trên cùng bên phải.
Điều tôi cần xảy ra là có thể căn chỉnh phía dưới TextView
dưới bất kỳ chế độ xem nào là thấp nhất.
Đây là layout XML của tôi:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/itemImageView"
android:layout_width="100dp"
android:layout_height="80dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:src="@drawable/id_image" />
<TextView
android:id="@+id/itemContentsTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/itemImageView"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:text="Sample contents\nSample contents\nSample contents" />
<TextView
android:id="@+id/itemIdTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="@+id/itemContentsTextView"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:text="1234" />
</RelativeLayout>