Frontend Engineer
ImageViewにandroid:adjustViewBounds="true"
を設定する。
すると横幅いっぱいに表示した上でアスペクト比を保ちつつ高さを自動設定してくれる。
例
<ImageView android:id="@+id/imageView" android:layout_width="0dp" android:layout_height="wrap_content" android:adjustViewBounds="true" tools:src="@tools:sample/avatars" />
ImageViewにandroid:adjustViewBounds="true"
を設定する。
すると横幅いっぱいに表示した上でアスペクト比を保ちつつ高さを自動設定してくれる。
例
<ImageView android:id="@+id/imageView" android:layout_width="0dp" android:layout_height="wrap_content" android:adjustViewBounds="true" tools:src="@tools:sample/avatars" />
Frontend Engineer