我目前正在使用此代码,但背景没有改变。它仍然显示强调色作为背景。
<com.google.android.material.button.MaterialButton
android:id="@+id/materialButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello"
app:cornerRadius="32dp"
android:background="@drawable/gradiant_blue"/>
渐变蓝.xml
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="-45"
android:startColor="#2979FF"
android:endColor="#7C4DFF"/>
</shape>
我目前正在使用
材料组件版本:1.0.0-rc02