常用,记录一下。
效果图:
首先新建xml文件 bg_gradient.xml
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >
<gradient
android:startColor=\"#55FF0000\"
android:centerColor=\"#99A73C3C\"
android:endColor=\"#99000000\"
android:angle=\"270\"
/>
<corners android:radius=\"0dip\" />
</shape>
在布局文件里面引用
android:background=\"@drawable/bg_gradient\"
本文地址:https://www.stayed.cn/item/6971
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我