也許這是一個愚蠢的問題,但我無法找到一種方法來在TextView的第二行結束時插入小圖像。圖像總是顯示在整個文本視圖的右側,而不是行結束。如何在多行TextView的末尾插入ImageView?
我想插入圖片是這樣的:
TextTextTextTextTextTextTextTextTextText
TextTextTextText. <ImageView>
我所得到的是:
TextTextTextTextTextTextTextTextTextText <ImageView>
TextTextTextText.
我希望有辦法做到這一點。
源:
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TESTESTESTESTESTESTESTESTESTESTESTESTES"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#FFFFFF" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/tv"
android:src="@drawable/icon" />
</RelativeLayout>
郵政編碼........ –
給你的xml代碼,更容易看到問題。 – Carnal
有一些代碼比。 – Sver