Description
Here is a simple example of an image with an overlay:
<Border Stroke="Transparent" Margin="5,0,0,0" WidthRequest="250">
<Border.StrokeShape>
<RoundRectangle CornerRadius="10"/>
</Border.StrokeShape>
<Grid>
<Image Source="dotnet_bot.png" Aspect="AspectFill" />
<VerticalStackLayout VerticalOptions="End" Padding="10">
<VerticalStackLayout.Background>
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
<GradientStop Color="Black" Offset="0.0" />
<GradientStop Color="#80000000" Offset="0.5" />
<GradientStop Color="Transparent" Offset="1.0" />
</LinearGradientBrush>
</VerticalStackLayout.Background>
<Label Text="Title" Style="{StaticResource MediumBoldTextStyle}" TextColor="White" />
<Label Text="Subtitle" Style="{StaticResource TinyTextStyle}" TextColor="White" />
</VerticalStackLayout>
</Grid>
</Border>
On Android, starting with version 10.0.60, the overlay renders as an opaque black box:
On iOS (and on Android in previous versions of MAUI), it renders as expected:
Steps to Reproduce
- Create a MAUI app.
- Add the following XAML markup:
<Border Stroke="Transparent" Margin="5,0,0,0" WidthRequest="250">
<Border.StrokeShape>
<RoundRectangle CornerRadius="10"/>
</Border.StrokeShape>
<Grid>
<Image Source="dotnet_bot.png" Aspect="AspectFill" />
<VerticalStackLayout VerticalOptions="End" Padding="10">
<VerticalStackLayout.Background>
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
<GradientStop Color="Black" Offset="0.0" />
<GradientStop Color="#80000000" Offset="0.5" />
<GradientStop Color="Transparent" Offset="1.0" />
</LinearGradientBrush>
</VerticalStackLayout.Background>
<Label Text="Title" Style="{StaticResource MediumBoldTextStyle}" TextColor="White" />
<Label Text="Subtitle" Style="{StaticResource TinyTextStyle}" TextColor="White" />
</VerticalStackLayout>
</Grid>
</Border>
- On Android, the overlay appears as a black box. Expected: a semi-transparent overlay with a gradient.
Link to public reproduction project repository
https://github.com/plequere-ms/maui-10-0-60-bug-repro
Version with bug
10.0.60
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
10.0.50
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
Description
Here is a simple example of an image with an overlay:
On Android, starting with version 10.0.60, the overlay renders as an opaque black box:
On iOS (and on Android in previous versions of MAUI), it renders as expected:
Steps to Reproduce
Link to public reproduction project repository
https://github.com/plequere-ms/maui-10-0-60-bug-repro
Version with bug
10.0.60
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
10.0.50
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output