Microsoft.Maui.Graphics icon indicating copy to clipboard operation
Microsoft.Maui.Graphics copied to clipboard

Transparency doesn't work in iOS FillRectangle()

Open naweed opened this issue 2 years ago • 1 comments

I noticed that filling a rectangle in iOS doen't set the background to transparent. It works fine on WinUI and Android. Here is the code. On iOS, it always yields White background. I tried FillPaint as well, but same issue.

private void DrawBackground(ICanvas canvas, RectF dirtyRect)
{
    canvas.SaveState();

    canvas.FillColor = Colors.Transparent; ////TODO: Bug Fix in iOS - Transparency doesn't work

    canvas.FillRectangle(dirtyRect);

    canvas.RestoreState();
}

naweed avatar Jun 26 '22 06:06 naweed

Has anyone found a workaround? I'm running into the same problem, even if I don't draw the rectangle. On Android the canvas is transparent by default, on iOS it's white.

WebGoose avatar Aug 29 '22 09:08 WebGoose