2012-09-26 155 views
4

您好與Android中的圖像按鈕選項混淆。我已經創建了三個圖像按鈕與下面的XML在android中的圖像按鈕樣式

<ImageButton 
     android:id="@+id/imageButton1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:src="@drawable/folder_add" /> 

    <ImageButton 
     android:id="@+id/imageButton4" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignTop="@+id/imageButton1" 
     android:layout_toLeftOf="@+id/imageButton1" 
     android:src="@drawable/search" /> 

    <ImageButton 
     android:id="@+id/imageButton2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignTop="@+id/imageButton4" 
     android:layout_toLeftOf="@+id/imageButton4" 
     android:src="@drawable/advancedsettings" 
     style="?android:attr/borderlessButtonStyle" /> 

但出像按鈕,圖像上的.. 請幫我來顯示圖像只button..Thnx提前!

+0

使用ImageView小部件來代替ImageButton小部件。 – mukesh

回答

9

把這個標籤在你ImageButton

android:background="@null" 

這將做到這一點。

+0

哦,是的,它確實...... thnks親愛的...... :) – user1682133

5

您還可以使用透明顏色:這將解決您的問題。

android:background="@android:color/transparent"