1

I use TextView and drawableRight:

<TextView
   android:id="@+id/text1_2"
   android:drawableRight="@drawable/star"
   android:layout_width="match_parent"
   android:layout_height="20dp"
   android:textColor="@color/grey_500"
   android:textSize="@dimen/category_bottom_text_size" />

But the image does not scale according to the textView's height and just crops. I tried different solutions, such as using a bitmap file for this image and making the image .9, but the result was the same.

3
  • can you use imageview itself?
    – Developer
    Commented Nov 30, 2018 at 12:20
  • layout_height should be wrap_content
    – Pavya
    Commented Nov 30, 2018 at 12:24
  • android:drawableRight can not be scaled, so you have to use big image instead or you can use seperate image from textview by using imageview seperately Commented Nov 30, 2018 at 12:36

1 Answer 1

0

Try to used.. textview in image scale

        android:scaleX="0.5"
    android:scaleY="0.5"
1
  • it will also scale the text
    – Ali Ahmed
    Commented Nov 30, 2018 at 12:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.