2012-08-26 106 views
0

I'm使用XML代碼用於水平的LinearLayout:如何刪除圖像的填充爲水平線性佈局?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="60dip" 
    android:orientation="horizontal" 
    android:paddingLeft="5dip" 
    android:paddingRight="5dip" 
    android:layout_alignParentBottom="true" 
    android:background="@drawable/back1" 
    > 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="60dip" 
     android:clickable="true" 
     android:contentDescription="@string/app_name" 
     android:src="@drawable/ca_18" 
     android:adjustViewBounds="true"/> 
</LinearLayout> 

和ImageView的具有填充頂部和底部。我怎樣才能刪除填充?

+1

這可能是因爲你的高度屬性不是wrap_content –

+0

我改爲android:layout_height =「match_parent」(在ImageView中),沒有任何改變 –

回答

2

避免對layout_height和layout_width屬性進行硬編碼。這可能在你的設備上看起來很好。但在另一個看起來很醜。