Có lẽ đó là một câu hỏi ngu ngốc, nhưng tôi không thể tìm thấy một cách để chèn hình ảnh nhỏ ở cuối dòng thứ hai của TextView. Hình ảnh luôn xuất hiện ở bên phải của toàn bộ chế độ xem văn bản, không xuất hiện ở đầu dòng.Làm cách nào để chèn ImageView vào cuối TextView đa dòng?
Tôi muốn chèn hình ảnh như thế này:
TextTextTextTextTextTextTextTextTextText
TextTextTextText. <ImageView>
Những gì tôi nhận được là:
TextTextTextTextTextTextTextTextTextText <ImageView>
TextTextTextText.
Tôi hy vọng có cách để làm điều đó.
Src:
<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>
mã bưu điện ........ –
Cung cấp mã xml của bạn, dễ dàng hơn để xem sự cố. – Carnal
Có một số mã hơn. – Sver