我正在进行测试示例。在某些图像背景中,它们使用渐变,代码如下:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#ff0000"
android:centerColor="#00ff00"
android:endColor="#0000ff"
android:angle="180"/>
<corners android:radius="5dp" />
</shape>
在上述XML中,我没有得到angle
属性。但是当我稍微改变angle
的值时,图案会倾斜。有人能解释一下它是如何工作的吗?