1

In .Net Maui I creates a new Page and inserted a BoxView, I added a Background Gradient with 2 GradientStops.

Tested it on Android and iOS and it does not seem to work.

<Grid  HeightRequest="200" WidthRequest="200"  >
  <Grid.Background>
    <LinearGradientBrush EndPoint="0,1">
      <GradientStop Color="Red"
                    Offset="0.1" />
      <GradientStop Color="Green"
                    Offset="0.8" />
    </LinearGradientBrush>
  </Grid.Background>
</Grid>

<BoxView  HeightRequest="200" WidthRequest="200" >
  <BoxView.Background>
    <LinearGradientBrush EndPoint="0,1">
      <GradientStop Color="Red"
                    Offset="0.1" />
      <GradientStop Color="Green"
                    Offset="0.8" />
    </LinearGradientBrush>
  </BoxView.Background>
</BoxView>

enter image description here

GeoSaffer
  • 143
  • 12

1 Answers1

1

To fix this issue set the Color to Transparent and you will see the background gradient

<BoxView  HeightRequest="200" WidthRequest="200" Color="Transparent" >
  <BoxView.Background>
    <LinearGradientBrush EndPoint="0,1">
      <GradientStop Color="Red"
                    Offset="0.1" />
      <GradientStop Color="Green"
                    Offset="0.8" />
    </LinearGradientBrush>
  </BoxView.Background>
</BoxView>
GeoSaffer
  • 143
  • 12
  • Consider adding an issue at `github maui issues`, showing the problem, and your work-around. It should be an easy change for devs to make the default Color transparent, so app dev doesn't have to. – ToolmakerSteve Jun 28 '23 at 18:00