Section1
<?xml version="1.0" encoding="utf-8"?> <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="@color/black" android:endColor="@color/white" /> </shape>这个是最简单的从黑到白
我们调换一下角度Section2
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:angle="90" android:startColor="@android:color/black" android:endColor="@android:color/white" /> </shape>
可以看到,这里的角度是逆时针方向旋转的。Section3
type属性,前面介绍的渐变色的type都是linear,除了linear之外,还有radial和sweep这两种后文介绍。。。。。
Android渐变色制作
最新推荐文章于 2024-05-11 09:43:16 发布