I create a SweepGradient
like this
int[] colors = { Color.RED, Color.BLUE };
// float[] positions = {0,1}; => this will work without error
float[] positions = { 0 , 280f/360 };
SweepGradient gradient = new SweepGradient(width / 2, height / 2, colors, positions);
When I set float[] positions = {0,1}
, it will work correctly (no error).
When I change to float[] positions = { 0 , 280f/360 }
, in the Preview mode of AndroidStudio
it displays an rendering error but in the simulator it works fine
Why this happend? How can I fix it?