使用一个包含所有属性的shape作为button的background来代替backgroundTint,并将cornerRadius作为shape的属性之一。
样例代码:
在res/drawable目录下创建一个button_background.xml文件,内容如下:
在布局文件中,使用这个xml文件作为button的background:
注意:其中的color和radius需要根据你的实际需求进行修改。
上一篇:backgroundTint属性会给整个TextInputEditText上色。
下一篇:BackgroundtoggleJS只能使用一次