给button或者某个布局加背景,想用渐变色,在drawable里新建一个resourceFile
1.橙红色
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#fe6969"
android:centerColor="#fb7a6a"
android:endColor="#ff976d"
android:angle="135"
/>
<corners
android:radius="10dp"/>
</shape>
2.紫色
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#6502DA"
android:centerColor="#7F05E9"
android:endColor="#D701FA"
android:angle="135" />
<corners
android:radius