I often need to have some piece of dynamic text in a TextView
, with some drawable image at the end of it.
I'm having troubles making it look nice when the text needs to span onto 2 lines. I would want the image to go inline with the text.
This is what it looks like:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="This is my favourite which has a really long piece of string which will wrap"
app:drawableEndCompat="@drawable/ic_baseline_favorite_border_24" />
This is what I want it to look like:
Drawable End in a TextView
, or putting an ImageView
next to a TextView
doesn't work. Is there an easy way to get this image inline with the text as if it is part of the text?