android 4.1.2中,layer-list的颜色变为黑色

时间:2015-01-09 12:57:38

标签: android

这是完整的xml:

<item>
    <shape android:shape="rectangle" >
        <solid android:color="@color/pink" />
    </shape>
</item>
<item>
    <shape android:shape="rectangle" >
        <stroke
            android:width="@dimen/border_size"
            android:color="@android:color/white" />
    </shape>
</item>

它所做的只是粉红色的背景颜色和白色轮廓。当我使用android 4.2.2测试它时,它工作得很好。

然而,粉红色的背景颜色总是变成android 4.1.2中的黑色(轮廓仍然是白色的 - 这样工作正常)。

请注意,我使用真实设备(不是模拟器的粉丝)

请帮助我,谢谢你的帮助。

注意:我已尝试清理项目,卸载应用程序。

感谢@Der Golem,这是工作简化的代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <solid android:color="@color/pink" />

    <stroke
        android:width="@dimen/border_size"
        android:color="@android:color/white" />

</shape>

1 个答案:

答案 0 :(得分:2)

你真的需要 2个叠加形状吗? 一个就够了。

只需在相同的形状上设置实心(填充)颜色和笔触(边框)颜色。

相关问题