maui
maui copied to clipboard
[Catalyst] Fix brushes in Frame
Description of Change
Brushes were not rendering on the Frame in Catalyst. The issue is that we weren't updating the size of the Layer used to draw the gradient when resizing the UIView.

Issues Fixed
Fixes #7261 Fixes #8108 Fixes #8402
Rebase to net6.0? @jsuarezruiz
Rebase to net6.0? @jsuarezruiz
Done.
As a workaround, you can replace Frame with ContentView to see if it also works for you: Example code:
<ContentView
HeightRequest="120"
HorizontalOptions="FillAndExpand"
Margin="-2"
Padding="20, 45, 20, 0">
<ContentView.Background>
<LinearGradientBrush>
<GradientStop Color="#00A7B5" Offset="0.1" />
<GradientStop Color="#721474" Offset="1.0" />
</LinearGradientBrush>
</ContentView.Background>
</ContentView>
If you need border, border radius and shadow, you can combine ContentView with Border and Shadow MAUI elements.
Changed target from net6.0 to main and rebased changes.
/backport to net7.0
Started backporting to net7.0: https://github.com/dotnet/maui/actions/runs/3649773298