-2
我有一個imageview,它將隨後包含一些隨機大小的圖像 我想用圖像填充imageview,但保留比例爲 (所以不要使用縮放類型FITXY或centercrop因爲它修剪我的圖像的一部分)將隨機大小的圖像合成到ImageView中
我該怎麼做?
在這個測試代碼,我有左,我的圖片
<?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"
/>
有的話o澄清會很好 – Najzero