我想在项目中使用 imageView
,但它显示了布局中的其他空间。如何删除多余的空间?
此图显示了问题:
XML代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="com.tellfa.smsbox.activities.Dialog_image_show">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:src="@drawable/cover_menu_bg" />
</RelativeLayout>
</RelativeLayout>
我不想使用 android:scaleType =“centercrop”
。
最佳答案
使用像这些
的 ImageView<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/icon"
android:id="@+id/imv"
android:scaleType="fitCenter" />
关于android - Android中如何删除ImageView的额外空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34129120/