1、设置渐变背景
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:centerColor="#1FBDFF"
android:endColor="#1FA5FF"
android:startColor="#02EEFF"
android:type="linear" />
</shape>
2、设置圆角渐变按钮
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 连框颜色值 -->
<item>
<shape>
<corners android:radius="4dp" />
</shape>
</item>
<!-- 主体背景颜色值 -->
<item
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
android:top="1dp">
<shape>
<gradient
android:centerColor="#1FBDFF"
android:endColor="#1FA5FF"
android:startColor="#02EEFF"
android:type="linear" />
<!-- 圆角 -->
<corners android:radius="4dp" />
</shape>
</item>
</layer-list>
3、TextView设置不同颜色
SpannableString receiver = new SpannableString(beanInfo.getUpdator() + "领取");
receiver.setSpan(new ForegroundColorSpan(Color.parseColor("#5B6175")), beanInfo.getUpdator().length(), beanInfo.getUpdator().length() + 2, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
tvReceiver.setText(receiver);