Android L is ignoring shapes as drawable background

青春壹個敷衍的年華 提交于 2019-12-03 11:08:51
user3781482

I found that wrapping the shape in a selector and item tag made it work

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">

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

            <corners
                android:bottomLeftRadius="3dp"
                android:topRightRadius="3dp"
                android:topLeftRadius="3dp"
                android:bottomRightRadius="3dp" />

        </shape>
    </item>
</selector>

Just use android:radius, not use each corner options. I had a same problem, but I was able to solve the problem using this way.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" android:padding="3dp">
<solid android:color="#999999"/>
  <corners android:radius="2dp"/>
</shape>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!