unexpected behavior when navigating between pages in my Maui App using AppShell .

Graja Kaouthar 20 Reputation points
2025-01-10T10:02:56.25+00:00

appshell navigation

I'm using AppShell for navigation in my .NET MAUI application. However, sometimes when I click on a menu item, an unexpected new line appears at the top of my app. This line remains visible until I completely exit the application. What could be causing this issue?

this is a snippet from AppShell:

<Shell.Resources>

<ResourceDictionary>

    <!--  Android platform  -->

    <Style x:Key="AndroidShell" TargetType="Shell">

        <Setter Property="Shell.FlyoutBehavior" Value="Flyout" />

    </Style>
</Shell.Resources>

<Shell.FlyoutHeader>

<Grid BackgroundColor="#1877F2" HeightRequest="200">

<Image Source="logo_lbt_blanc.png" WidthRequest="100" />
</Grid>
</Shell.FlyoutHeader>

<ShellContent

x:Name="Accueil"

Title="Accueil"

ContentTemplate="{DataTemplate views:Accueil}"

Icon="home.png" />


x:Name="CatalogueProduit"

Title="Catalogue"

ContentTemplate="{DataTemplate views:Catalogueproduit}"

Icon="catalogueproduit.png"

Route="Catalogueproduit" />


Title="Commandes"

Icon="sales.png"

Route="Commandes">

<ShellContent

Title="Nouveau"

ContentTemplate="{DataTemplate views:ccView}"

Route="ccView" /> <ShellContent

Title="Nouveau"

ContentTemplate="{DataTemplate views:ccinsertionView}"

IsVisible="False"

Route="ccinsertionview" /> <ShellContent

Title="Listes"

ContentTemplate="{DataTemplate views:cccollectionView}"

Route="cccollectionView" /> </FlyoutItem>

<FlyoutItem

Title="Bons de Livraison"

Icon="delivery_note.png"

Route="Bonsdelivraison">

<ShellContent

Title="Nouveau"

ContentTemplate="{DataTemplate views:cblView}"

Route="cblView" />


powershell
Title="Nouveau"

ContentTemplate="{DataTemplate views:cblinsertionView}"

IsVisible="False"

Route="cblinsertionview" />
<ShellContent


Title="Listes"

ContentTemplate="{DataTemplate views:cblcollectionView}"

Route="cblcollectionView" />
</FlyoutItem>

<FlyoutItem

Title="Clients"

Icon="clients.png"

Route="Clients">

<ShellContent

Title="Listes"

ContentTemplate="{DataTemplate views:Clients}"

Route="Clients" />
</FlyoutItem> 

and in my contentpage for example for this in the picture i define it like this:  

Title="Nouveau Bon de Livraison"

x:DataType="views:cblViewModel"

BackgroundColor="White"

HideSoftInputOnTapped="True"

Shell.BackgroundColor="#1877F2"

Shell.ForegroundColor="White"

Shell.NavBarIsVisible="true"

Shell.TitleColor="White" 

thanks for any help.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,805 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
826 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.