Search code examples
c#.netmaui.net-mauimaui-community-toolkit

How to remove Actionbar In MAUI


My XAML Code for view

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         BackgroundColor="White"
         Title=""
         x:Class="Chuxi.MainPage">

<ScrollView>
    <VerticalStackLayout
        Spacing="25"
        Padding="30,0"
        VerticalOptions="Center">



    </VerticalStackLayout>
</ScrollView>

I have Tried C# Code TO Remove BUt Doesnt Working

public MainPage()
 {
    NavigationPage.SetHasNavigationBar(this, false);
    InitializeComponent();
 }

How Can I Remove Title Bar And Make It Full Screen View


Solution

  • This May Help You. Its working For me

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage NavigationPage.HasNavigationBar="false" 
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             BackgroundColor="White"
             Title=""
             x:Class="Chuxi.MainPage">
    
    <ScrollView>
        <VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">
    
    
    
        </VerticalStackLayout>
    </ScrollView>
    
    </ContentPage>
    

    Any Issue ask me on comment. Thank You