android常用配色(按钮背景)

  • Post author:
  • Post category:其他


给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="10dp"/>

</shape>

3.蓝色

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <gradient
        android:startColor="#01BBD5"
        android:centerColor="#00CFEB"
        android:endColor="#04E3FF"
        android:angle="135" />
    <corners
        android:radius="10dp"/>

</shape>

4.绿色

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <gradient android:startColor="#04E260"
        android:centerColor="#03FF53"
        android:endColor="#02FF6E"
        android:angle="135" />
    <corners
        android:radius="10dp"/>

</shape>



版权声明:本文为qq873044564原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。