Android布局和图像按钮和灰色边框

时间:2011-07-13 16:00:27

标签: android android-layout

我已经看到了一些关于此问题的线索,但我并不想要找到它。

我有一个图像按钮,它位于黑色背景上。

图像按钮有一个巨大的灰色边框。我试图关闭边框,并使边框变黑......它没有工作。我只是希望按钮在屏幕上具有透明背景,并尽可能扩大一点。没有灰色。

有任何线索吗?

enter image description here

    

</LinearLayout>
<LinearLayout android:layout_width="wrap_content"
    style="@android:style/ButtonBar" android:layout_height="wrap_content"
    android:orientation="vertical">

    <ImageButton android:layout_height="wrap_content"
        android:src="@drawable/map" android:id="@+id/ImageButton1" 
        android:layout_width="fill_parent">
    </ImageButton>

    <ImageButton android:layout_height="wrap_content"
        android:src="@drawable/list" android:id="@+id/ImageButton2" 
        android:layout_width="fill_parent">
    </ImageButton>

    <ImageButton android:layout_height="wrap_content"
        android:src="@drawable/share" android:id="@+id/ImageButton3" 
        android:layout_width="fill_parent">
    </ImageButton>

</LinearLayout> </LinearLayout>

1 个答案:

答案 0 :(得分:9)

我想我知道你在谈论什么。试一试。您想要包含android:background="@null"以摆脱那个灰色轮廓。

例如,在您声明ImageButton的布局中:

<ImageButton android:background="@null" ...>
    .
    .
    .
</ImageButton>