How to fill rectangle with opacity in android

后端 未结 1 1716
误落风尘
误落风尘 2021-02-19 07:36

I can fill rectangle with canvas draw rect:

Rect rt = new Rect(0, 0, getWidth(), getHeight());
myPaint.setColor(myColor);
myPaint.setStyle(Style.FILL);
canvas.dr         


        
相关标签:
1条回答
  • 2021-02-19 08:13

    You can use the Alpha property of Paint class.

    myPaint.setAlpha(10); will help you.

    0 讨论(0)
提交回复
热议问题