2013-07-24 39 views
4

我正在渲染由圖像組成的ListView。我希望擺脫飛機的灰色。我該如何擺脫?看起來很奇怪,而且很容易,但我無法找出解決方案。刪除圖像ListView中的不安全空間

enter image description here

list_View.xml

<?xml version="1.0" encoding="UTF-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#efefef" 
    android:orientation="vertical" > 



    <ListView 
     android:id="@android:id/list" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 

     android:cacheColorHint="#00000000" 
     android:divider="@android:color/black" 
     android:dividerHeight="1.0sp" 
     android:textColor="#000000" /> 

</RelativeLayout> 

image.xml

+0

嗨,可以粘貼一些代碼?我只看圖片就可以對這個原因進行10次猜測。 – g00dy

+0

@ g00dy請檢查編輯 – onkar

+0

也許將'LinearLayout'的背景設置爲'color/transparent'?這是一個可視化的圖像,我的意思是我看到「殭屍」和「病毒」,但是這兩個圖像還是一個整體? – g00dy

回答

2

<ImageView 
    android:id="@+id/imageStatus" 
    android:layout_alignParentTop="true" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scaleType="fitXY" <!-- This will Help you --> 
    android:adjustViewBounds="true" /> 

您還可以設置使用>>>

android:minHeight="120dp" 
android:minWidth="100dp" 
1

編輯您的代碼在ListView以下幾點:

android:layout_height="wrap_content" 
1

試試這個以您的圖像視圖屬性最小寬度&高度

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    ...> 

    <ImageView 
     ... 
    android:scaleType="matrix" /> 

</LinearLayout>