6

こんにちは、Android の画像ボタン オプションと混同しています。次のxmlで3つの画像ボタンを作成しました

<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" />

しかし、アウトは画像付きのボタンのようなものです..ボタンとしてのみ画像を表示するのを手伝ってください..事前にThnx!

4

2 に答える 2

11

このタグをあなたのImageButton

android:background="@null"

これでうまくいきます。

于 2012-09-26T10:26:17.470 に答える
6

透明色を使用することもできます。これで問題が解決します。

android:background="@android:color/transparent"
于 2012-09-26T10:29:51.403 に答える