1

I am trying to use the Android Holo.Light theme and for some reason when I add a background image, it makes the buttons look very strange and see-through. Here is a screen shot:

enter image description here

Would anyone know why this happens? It looks very strange. Is it meant to be like that? Or am I doing something incorrectly?

When I had just Light as my theme, the same image was not see-through.

Thank you!

4

1 回答 1

2

Holo 按钮的默认设置略微不透明。只需为他们设置一个可绘制的背景!

这是一个带有 1px 轮廓的灰色按钮的示例。包括按下状态。您将使用“android:background="@drawable/gray_btn" 在按钮上进行设置:

@drawable/gray_btn.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
    <shape>
        <solid
            android:color="#ffffff" 
            />
        <stroke
            android:width="1dp"
            android:color="#E3E3E3" />
        <corners
            android:radius="4dip" />

    </shape>
</item>
<item>
    <shape>
        <solid
            android:color="#edeff1" 
            />
        <stroke
            android:width="1dp"
            android:color="#E3E3E3" />
        <corners
            android:radius="4dip" />

    </shape>
</item>

于 2013-06-03T15:33:29.677 回答