正方形の画像 (約 315 dp x 315 dp) を、幅いっぱいに高さ約 200 dp の画像にスケーリングしようとすると、問題が発生します。
基本的に私がやろうとしているのは、画像がより長方形にスケーリングされたときに、画像の縦横比を適切に維持することです。何か案は?これが私が試したことです:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
</LinearLayout>