1

我为线性布局设置了背景。但是我的按钮被这种颜色覆盖了。我需要正常的按钮颜色。

<LinearLayout
    android:id="@+id/expandable"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#000000"
    android:orientation="horizontal" >

    <Button
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:text="Delete"
        android:drawableLeft="@drawable/content_discard" />

</LinearLayout>

我的布局图片

请我帮帮我。

4

2 回答 2

1

在您的按钮标签中写下:

   <Button
   android:background = "#D3D3D3"/>
于 2013-08-15T09:39:39.667 回答
1

您可以使用

android:background="@android:drawable/btn_default"

例子 :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/expandable"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#000000"
    android:orientation="horizontal" >

    <Button
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:background="@android:drawable/btn_default"
        android:text="Delete" />

</LinearLayout>

您将获得以下输出:

在此处输入图像描述

于 2013-08-15T09:42:54.710 回答