【发布时间】:2015-12-07 08:19:48
【问题描述】:
我想在我的项目中使用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"。
【问题讨论】:
-
使用
android:scaleType="fitXY" -
@Aashvi, tnx 但我不想使用
scaleType方法 -
@Stankovitch,感谢我亲爱的朋友。我用这个代码修复它:
android:scaleType="fitStart" android:adjustViewBounds="true" -
只是剪切和缩小图像的透明部分。