2012-05-05 42 views
-1

我試圖創建一個全屏Imagebutton。但我一直在變灰色邊框。全屏ImageButton

<ImageButton 
     android:id="@+id/StartButton" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"   
     android:src="@drawable/startscreen" /> 

我有嘗試伸展PIC到全屏幕上食,但仍有顯示圖片周圍的灰色邊框。

我想知道是由於我的設置或圖片分辨率的分辨率。我正在研究星系筆記。

+0

使用ImageView並設置onclicklistener。檢查出來 - > http://stackoverflow.com/questions/2283444/android-image-button – Proxy32

回答

2

這應該刪除灰色邊框

<ImageButton 
     android:id="@+id/StartButton" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"   
     android:src="@drawable/startscreen" 
     android:background="#000000"/> 
0

@ Proxy32的想法可能是最好的一個。或者,不要使用android:src屬性,而使用android:background。您也可以使用簡單的Button,而不是將背景設置爲可繪製的,並將文本留出。