android gradient background

Effect picture:
Insert picture description here
Make a gradient background,
1. Create an xml
content as follows (just copy the past):

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <!--实现应用背景颜色渐变-->
    <gradient
        android:startColor="#BBF1FF"
        android:endColor="#66E0FF"
        android:angle="0"/>
</shape>

android:startColor: the color of the starting gradient on the left
android:endColor: the ending color of the right
android:angle: from left to right
2. After creating it, apply it directly where needed, using the background attribute

Guess you like

Origin blog.csdn.net/weixin_44538566/article/details/107619381