I started playing with gradients and I've found it's pretty easy to draw 1-directional gradient (like from top to bottom, from left to right, or in diagonale...) but how to draw 2-directional gradient? I mean something like this:
Big blue rectangle it's 2-directional gradient - on top right corner there is blue and to the left its transforming to white and to the bottom it's transforming to the black. How to draw this?
You can do something like this when you create your
gradient
color:Specify the color you desire for the
start/end/center
location of thegradient
, and specify the angle of the color switching.Answer is: you must combine 2 different LinearGradients, for example:
;
And of course important:
on phones with 3.0 android and higher