E
E
Ernesto Guevara2015-04-03 16:27:45
Android
Ernesto Guevara, 2015-04-03 16:27:45

How to vertically center text and ImageSpan on each line in a TextView?

I create a SpannableString and add an ImageSpan to it, in the TextView the multiline text is displayed so that the lines are aligned to the bottom of the pictures:
1656a3680b35456db27a5f446ab059f1.jpg
We need to make sure that the text is aligned relative to the middle of the picture vertically on each line of the Multiline TextView:
5729ebf8293c4696bbd283f59e3c3f76.jpg
Tried various flags and ImageSpan. ALIGN_BASELINE including, but didn't help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question