android ripple button with background

给你一囗甜甜゛ 提交于 2019-12-04 07:00:31

Using the @android:id/mask identifier sets the layer as a mask, which is only used for clipping bounds and is not drawn. Removing the id attribute should give you what you're looking for. Also, you can just use the android:radius attribute if the corners are all the same radius.

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