How to put an clickable image in between string using a single TextView.
Using SpannableString, I am able to color part of string. But how to add a colored image? Any suggestion would be really appreciated.
How to put an clickable image in between string using a single TextView.
Using SpannableString, I am able to color part of string. But how to add a colored image? Any suggestion would be really appreciated.
Copyright © 2021 Jogjafile Inc.

This is not possible for a single
TextViewelement.TextViews are not meant to contain images in the middle of them.You can, however, add drawable resources to the top, right/start, left/end, or bottom of a given
TextViewby leveraging thedrawableTop,drawableBottom, etc. attributes. But again, no way of adding an image in the middle of aTextViewby using only one of them.If you really want that specific effect, I would group a few XML components into any
ViewGrouplike aConstraintLayoutto get exactly what you want; e.g.