圖像用戶所以我有一個ImageView的,這將檢索數據庫中的圖像,以顯示它的程序。然而,我想要檢索的圖像調整到特定的高度和寬度(因此它不應該填滿整個屏幕)調整輸入到ImageView的
我想它的寬度爲150dp,而它的高度爲230dp。
然而,在數據庫中的圖像可以爲空,正因爲如此,我們不能設置的ImageView的高度和寬度,否則就會出現在佈局上的空白空間。
所以,我怎麼能調整圖片的大小?
以下是我當前的代碼:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_gravity="center"
android:id="@+id/Img" />