Android如何在旧版本上设置按钮外观?

Android如何在旧版本上设置按钮外观?,android,button,layout,Android,Button,Layout,我正在尝试在android上制作一个应用程序。我希望按钮是透明的,如图右侧(当我在安卓4.2.2上运行应用程序时),但当我在安卓2.3.3上运行应用程序时,按钮变成不透明和白色(如左侧)。有没有办法在旧版本上使用透明按钮,使其看起来像新版本上的按钮 (应用程序是捷克语的:我懒得设置新的英语字符串;) 感谢您的每一个回复,我为任何糟糕的英语道歉请使用纯色和alpha定义形状: myshape.xml <?xml version="1.0" encoding="UTF-8" ?> &l

我正在尝试在android上制作一个应用程序。我希望按钮是透明的,如图右侧(当我在安卓4.2.2上运行应用程序时),但当我在安卓2.3.3上运行应用程序时,按钮变成不透明和白色(如左侧)。有没有办法在旧版本上使用透明按钮,使其看起来像新版本上的按钮

(应用程序是捷克语的:我懒得设置新的英语字符串;)


感谢您的每一个回复,我为任何糟糕的英语道歉

请使用纯色和alpha定义形状:

myshape.xml

<?xml version="1.0" encoding="UTF-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="#42000000" />
</shape>


并将其保存在内部
红色/可绘制的
。将其作为按钮的背景

在按钮的背景中使用以下xml文件:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" android:state_enabled="true"
        android:drawable="@drawable/btn_default_normal_holo_dark" />
    <item android:state_window_focused="false" android:state_enabled="false"
        android:drawable="@drawable/btn_default_disabled_holo_dark" />
    <item android:state_pressed="true" 
        android:drawable="@drawable/btn_default_pressed_holo_light" />
    <item android:state_focused="true" android:state_enabled="true"
        android:drawable="@drawable/btn_default_focused_holo_dark" />
    <item android:state_enabled="true"
        android:drawable="@drawable/btn_default_normal_holo_dark" />
    <item android:state_focused="true"
        android:drawable="@drawable/btn_default_disabled_focused_holo_dark" />
    <item
         android:drawable="@drawable/btn_default_disabled_holo_dark" />
</selector>


它对我不起作用,它会抛出错误:找不到与给定名称匹配的资源这与我要查找的不完全一致,我希望按钮的行为类似于按钮,这更像TextView。按钮是TextView的子类