设置button圆角的时候遇到的问题 设置了如下属性
android:background="@drawable/bg_btn2"并没有实现圆角的效果 以下是bg_btn2.xml的代码
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#8BC34A" /> <corners android:radius="100dp" /> </shape>查了很多资料,发现可能是因为在Manifest.xml有一个应用到全局的themes的缘故,如下最后一行
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.HelloWorld" >这里的Theme.HelloWorld我找到后发现,对里面的颜色进行改变是可以实现按钮的改变的,但我要对某一个button进行圆角设置却不能覆盖它。
想知道除了暴力删除,没有别的办法了吗???
还有一点,可以通过以下设置改变button背景色,这个可以覆盖掉theme
android:backgroundTint="#89FB5F"