我的用于查看的 XAML 代码
<?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>
我已尝试使用 C# 代码删除但不起作用
public MainPage()
{
NavigationPage.SetHasNavigationBar(this, false);
InitializeComponent();
}
如何删除标题栏并使其全屏 View
最佳答案
这可能对您有帮助。它对我有用
<?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>
任何问题都可以评论问我。谢谢您
关于c# - 如何在 MAUI 中删除操作栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73230929/