Closed wulean closed 1 month ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
This issue has been verified using Visual Studio 17.11.0 Preview 3 (8.0.70 & 8.0.61 & 8.0.10). Can repro it.
What you're trying to hide is the status bar, which is not possible. You can customize your status bar color, by using Maui.CommunityToolkit package resources
@JesseIngles Thanks for your suggestion, but it doesn't seem to work if I add
BackgroundColor="{DynamicResource PageBackgroundColor}"
to the xml
<?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"
xmlns:local="clr-namespace:myApps"
x:Class="myApps.MainPage"
NavigationPage.HasNavigationBar="False"
NavigationPage.HasBackButton="False"
Shell.NavBarIsVisible="False"
Shell.TabBarIsVisible="False"
BackgroundColor="{DynamicResource PageBackgroundColor}">
<BlazorWebView x:Name="_blazorWebView" HostPage="wwwroot/index.html" UrlLoading="Handle_UrlLoading">
<BlazorWebView.RootComponents>
<RootComponent Selector="#app" ComponentType="{x:Type local:Main}" />
</BlazorWebView.RootComponents>
</BlazorWebView>
</ContentPage>
As pointed out this is not the navigation bar but the status bar. You can influence this color either with the .NET MAUI Community Toolkit functionality or set the color in Platforms/Android/Resources/values/colors.xml
Description
.net8.0 之後似乎無法透過
NavigationPage.HasNavigationBar="False"
來隱藏 NavigationBarAndroid/MainActivity.cs
Steps to Reproduce
NavigationPage.HasNavigationBar="False"
加入 MainPage.xamlLink to public reproduction project repository
No response
Version with bug
8.0.61 SR6.1
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
7.0.100
Affected platforms
Android
Affected platform versions
Android 14.0
Did you find any workaround?
無
Relevant log output