2011-03-04 8 views
1

私は、ユーザーが配色を変更できるアプリケーションを作成したいと思います。私はImagebuttonsを持っていて、ボタンの画像はpngで透明な背景を持っています。しかし、私はそれらをボタンに置​​くとき、もう透明ではありません。誰かが私にいくつかのコードを教えてくれますか?感謝! ありがとう! アンAndroid ImageButton:透明な背景を持つ画像

答えて

4

android:background="@null"が確実に設定されていますか?それ以外の場合は、グレーのボタンの背景があります。たとえば:

<ImageButton 
    android:background="@null" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/my_transparent_png" 
    /> 
0

はようImageButtonのためのあなたのレイアウトを記述します。

<ImageButton 
      android:src="@drawable/your_image" 
      android:id="@+id/your_id" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:background="@android:color/transparent"/> 

・ホープこのことができます!

関連する問題