3
我正在Xamarin上开发移动应用程序。Scale ImageView适合屏幕宽度/高度,同时保持宽高比
在应用程序中,有一个ImageView
显示的图像太小而不适合屏幕宽度。
我想缩放图像以适应屏幕的宽度,同时保持宽高比。
我axml
<LinearLayout
android:id="@+id/overlayImageContainer"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/overlayImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="fitCenter"/>
</LinearLayout>
结果
两个ImageViews显示)一个图像比所述屏幕的宽度宽,和b)一个图象比所述宽度窄的屏幕
我试过android:scaleType
和android:adjustViewBounds="true"
没有成功的各种组合。