Home > Enterprise >  Bring Label to the front in a Xamarin Grid
Bring Label to the front in a Xamarin Grid

Time:11-23

Im trying to have a Label on top of the Map but when I put them inside a Grid like this

<Grid HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Red">
                        
                        <Frame BackgroundColor="{StaticResource Color2}" Margin="0">
                            <Label TextColor="{StaticResource Color5}" FontSize="60" FontAttributes="Bold" x:Name="TituloNombre" HorizontalOptions="CenterAndExpand"></Label>
                        </Frame>
                        
                        <local:CustomMap IsShowingUser="True" HasScrollEnabled="True" HasZoomEnabled="True" MapClicked="mapaXaml_MapClicked" x:Name="mapaXaml" Opacity="0.5"/>

                    </Grid>

The map covers the Label and the only way I can see it is by changing the opacity of the map.

Map with Opacity 0.5

Map with Opacity 1

CodePudding user response:

Items within the Grid will be rendered back to front. Ie, things that are listed first will be behind things that are later in the same container

Reorder uour Grid so the Label is after the Map

  • Related