後でランダムなサイズの画像を含む画像ビューがあります。画像ビューに画像を入力しますが、比率は維持します(したがって、画像の一部がトリミングされるため、スケールタイプFITXYまたはセンタークロップは使用しないでください)
これどうやってするの ?
このテストコードでは、画像の左右に空白があります
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/imgTest"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/test"
/>