1

在此处输入图像描述

从上图中,如何去除图像周围的空白

imageview 布局是

<ImageView android:id="@+id/list_image"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"

android:layout_gravity="center_vertical"
android:scaleType="fitCenter"/>
4

3 回答 3

0

熟悉九个补丁:

http://developer.android.com/tools/help/draw9patch.html

于 2013-08-07T14:14:21.447 回答
0

添加到您的图像android:adjustViewBounds=true

如果仍然无法正常工作,请将布局大小更改为wrap_content

于 2013-08-07T14:18:52.807 回答
0

从您的问题下面的评论中,我了解到您想摆脱图像周围的空白,实际上这与Android.

您需要使用Gimp修改图像。

从上面的链接下载软件后,请按照以下步骤操作。

1) 用 Gimp 打开你的图像。

2)添加Alfa canal到您的图像。右键单击>图层>透明度>添加阿尔法通道

3) 选择图像上的空白区域,方法是使用fuzzy select tool工具箱中的单击该空白区域

在此处输入图像描述

4) 使用删除按钮删除空白。

5) 将图像另存为 .png

于 2013-08-07T14:38:26.583 回答