0

This is my ImageView in app (1) enter image description here

When I change size of container (LinearLayout for example) my ImageView change image size but border of view remained the same(2).

How I can set scaling for ImageView size and borders? (3)

My ImageView code in xml:

 <ImageView
            android:id="@+id/image"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:src="@drawable/cover" />

P.S. This is my problem in my app - enter image description here

Artem
  • 4,569
  • 12
  • 44
  • 86

1 Answers1

1

I find - stackoverflow.com/a/10124018/3871859 from here.

My ImageView xml:

<ImageView
            android:id="@+id/image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true"
            android:src="@drawable/cover" />

I just add this line:

android:adjustViewBounds="true"
Community
  • 1
  • 1
Artem
  • 4,569
  • 12
  • 44
  • 86