我有一个布局,左边有 ImageView,右边有 TextView:
<ImageView
android:src="@drawable/alert"
android:id="@+id/articleStoryImage"
android:layout_below="@+id/articleStorySubTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
/>
<TextView
android:id="@+id/articleStory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/articleStorySubTitle"
android:layout_toRightOf="@+id/articleStoryImage"
android:gravity="right"
android:inputType="textMultiLine"
android:text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
android:ellipsize="end"
android:layout_marginTop="10sp"
android:textSize="11sp"
android:textColor="#000000" />
我想要做的是,TextView 文本将从 ImageView 的右侧开始,但会在 ImageView 下方继续。你可以称之为某种溢出。
我怎样才能做到这一点?
谢谢。
编辑:完整的 XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="horizontal" >
<TextView
android:id="@+id/articleStoryTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb"
android:typeface="sans"
android:gravity="right"
android:ellipsize="end"
android:singleLine="false"
android:inputType="textMultiLine"
android:textSize="25sp"
android:textColor="#DBA118"
android:textStyle="bold" />
<TextView
android:id="@+id/articleStorySubTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/articleStoryTitle"
android:gravity="right"
android:inputType="textMultiLine"
android:text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb"
android:ellipsize="end"
android:layout_marginTop="10sp"
android:textSize="12sp"
android:textColor="#000000"
android:textStyle="bold" />
<ImageView
android:src="@drawable/alert"
android:id="@+id/articleStoryImage"
android:layout_below="@+id/articleStorySubTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
/>
<TextView
android:id="@+id/articleStory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/articleStorySubTitle"
android:layout_toRightOf="@+id/articleStoryImage"
android:gravity="right"
android:inputType="textMultiLine"
android:text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
android:ellipsize="end"
android:layout_marginTop="10sp"
android:textSize="11sp"
android:textColor="#000000" />
</RelativeLayout>