Изображение находится справа от макета. Он не отображается, если содержимое messagedetail_row_text слишком длинное. Изображение показывается, если содержимое messagedetail_row_text не слишком длинное.Почему изображение исчезает на макете?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="right"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/dfdwasdfds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/outgoing"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="22dip"
android:orientation="horizontal" >
<TextView
android:id="@+id/messagedetail_row_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="1dp"
android:textColor="#000000"
android:textSize="18sp" />
<TextView
android:id="@+id/messagedetail_row_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:paddingTop="1dp"
android:textColor="#000000"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/messagedetail_row_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="2dp"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@id/dfdwasdfds"
>
<ImageView
android:id="@+id/messagegedetail_rov_icon2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:gravity="right"
android:src="@drawable/retouxiang" />
</LinearLayout>
</RelativeLayout>
layout_below будет отображать изображение по содержанию, но я просто отобразить изображение справа из содержание. – user2559787
Вы указали свойство width width fill_parent, но макет родителей имеет свойство width width_content, поэтому оно займет пространство справа, когда оно длинное. Никакое пространство для изображения не исчезнет. @ user2559787 –
Вы можете попробовать с фиксированной шириной в родительском макете textView. –