如何消除图片周围的黑色边框

woc*_*dia 4 android image border

我需要删除Android屏幕中图片周围出现的黑色边框.我的结构是完全刀片,但我总是在纵向或横向方向上获得一种黑色边框.我试图改变参数但没有成功.这是我的xml布局代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ImageView 
android:src="@drawable/map" 
android:id="@+id/fullmap" 
android:layout_height="fill_parent" android:layout_width="fill_parent"> </ImageView>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

有人可以帮我找到错误吗?图片大于屏幕480x320 - 800x480 - 1280x800

在此输入图像描述

谢谢

Pra*_*nCG 5

如果用黑色边框表示图片左右两侧的空白区域,则需要在imageView标签中设置ScaleType.

第一个将拉伸图像而不保留纵横比

android:scaleType="fitXY" 
Run Code Online (Sandbox Code Playgroud)

这个将放大到图像,直到所有的边都填满,它保留纵横比.

android:scaleType="centerCrop"
Run Code Online (Sandbox Code Playgroud)