Gradient appears banded in a SurfaceView, but looks very smooth in a normal View

后端 未结 1 692
滥情空心
滥情空心 2020-12-06 13:18

My problem is that when drawing a simple test image (a rectangle with a gradient fill) within a SurfaceView, the gradient has colour banding. When drawing exact

相关标签:
1条回答
  • 2020-12-06 13:44

    Found the solution myself in the end by adding this into the SurfaceView's constructor:

    getHolder().setFormat(PixelFormat.RGBA_8888);
    
    0 讨论(0)
提交回复
热议问题