Gradient basically represents the variation in space(in a direction) of any quantity. With color it represents the variation of color intensity in a direction represented by angle. Here are some diagrams to represent this
concept:

Here the figure shows the color variation in horizontal direction(angle is set 0).
XML code:

Here the figure shows the color variation in horizontal direction(angle is set 90).
XML code:
You can also use different color as start, center and end colors. The code you attached contains all these elements.
本文介绍了如何使用Android XML代码实现颜色渐变效果,并通过设置不同的角度来改变渐变的方向。文中提供了两个示例,分别展示了水平方向(角度为0)和垂直方向(角度为90)的颜色渐变。
672

被折叠的 条评论
为什么被折叠?



