AndroidShape(背景渐变颜色)

it2022-05-05  152

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#FFACDAE5" android:endColor="#FF72CAE1" android:angle="45" /> </shape> Android背景色渐变(左上->右下) <gradient android:angle="135" android:centerColor="#4CAF50" android:endColor="#2E7D32" android:startColor="#81C784" android:type="linear" />

解释: startColor是渐变开始的颜色值,endColor是渐变结束的颜色值,angle是渐变的角度。其中#FFACDAE5中,FF是Alpha值,AC是RGB的R值,DA是RGB的G值,E5是RGB的B值,每个值在00FF取值,即透明度、红、绿、蓝有0255的分值,像要设置具体的颜色,可以在PS上的取色器上查看设置


最新回复(0)