Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to hide NavigationBar #23567

Closed
wulean opened this issue Jul 12, 2024 · 5 comments
Closed

Unable to hide NavigationBar #23567

wulean opened this issue Jul 12, 2024 · 5 comments
Labels
area-navigation NavigationPage platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@wulean
Copy link

wulean commented Jul 12, 2024

Description

.net8.0 之後似乎無法透過 NavigationPage.HasNavigationBar="False" 來隱藏 NavigationBar

Android/MainActivity.cs

protected override void OnCreate(Bundle savedInstanceState)
{
	base.OnCreate(savedInstanceState);
	this.Window.AddFlags(WindowManagerFlags.Fullscreen);
}

Steps to Reproduce

  1. 新增一個 .NET MAUI Blazor應用程式
  2. 使用 .net 8.0
  3. NavigationPage.HasNavigationBar="False" 加入 MainPage.xaml
  4. 執行 Android模擬器

Link 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

未命名

@wulean wulean added the t/bug Something isn't working label Jul 12, 2024
Copy link
Contributor

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!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed partner/android Issues for the Android SDK platform/android 🤖 and removed partner/android Issues for the Android SDK labels Jul 12, 2024
@kevinxufei
Copy link

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.

@JesseIngles
Copy link

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

@wulean
Copy link
Author

wulean commented Jul 15, 2024

@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>

@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Jul 23, 2024
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Jul 29, 2024
@samhouts samhouts added the area-navigation NavigationPage label Jul 31, 2024
@dotnet-policy-service dotnet-policy-service bot added s/no-recent-activity Issue has had no recent activity and removed s/no-recent-activity Issue has had no recent activity labels Jul 31, 2024
@jfversluis
Copy link
Member

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

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2024
@dotnet-policy-service dotnet-policy-service bot removed the s/no-recent-activity Issue has had no recent activity label Aug 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-navigation NavigationPage platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants