Is it possible to scale drawableleft & drawableright in textview?

前端 未结 8 2193
悲&欢浪女
悲&欢浪女 2020-12-14 05:53

I have TextView with drawableLeft & drawableRight in List item. The problem is, whenever the height of TextView is l

相关标签:
8条回答
  • 2020-12-14 06:14

    Maybe it's worth look at ImageSpan. It's a span that replaces the text it's attached to with a Drawable that can be aligned with the bottom or with the baseline of the surrounding. I think it will automatically scale it as well based on the height of the textview.

    https://developer.android.com/reference/android/text/style/ImageSpan

    0 讨论(0)
  • 2020-12-14 06:18

    The only acceptable answer here should be to use an ImageView with the scaleTypes as per usual. Hacky work arounds to scale an image on a TextView that isn't supported by Android seems.. unnecessary. Use the SDK as it was intended.

    0 讨论(0)
提交回复
热议问题