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

Shell.NavBarHasShadow not working correctly on Android #19458

Closed
gubhit1s opened this issue Dec 16, 2023 · 3 comments · Fixed by #20188
Closed

Shell.NavBarHasShadow not working correctly on Android #19458

gubhit1s opened this issue Dec 16, 2023 · 3 comments · Fixed by #20188
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout fixed-in-8.0.10 fixed-in-9.0.0-preview.2.10293 good first issue Good for newcomers platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@gubhit1s
Copy link

gubhit1s commented Dec 16, 2023

Description

Shell.NavBarHasShadow does not show the shadow under title bar on Android when being set on ContentPage. Stranglely when I debug the app and set this to false, then to true, the shadow does display.

Steps to Reproduce

  1. Create new .NET MAUI App, version .NET 8, or clone repo here: https://github.com/gubhit1s/MauiApp1

  2. In AppShell.xaml, set Shell.FlyoutBehavior="Flyout"

  3. In MainPage.xaml, add Shell.NavBarHasShadow="True"

  4. Debug the project, the shadow doesn't appear.
    image

  5. In debug mode, change Shell.NavBarHasShadow="False", the shadow doesn't appear.

  6. Also in debug mode, change Shell.NavBarHasShadow="True", the shadow appears.
    image

Link to public reproduction project repository

https://github.com/gubhit1s/MauiApp1

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 14

Did you find any workaround?

Trying to switch to CustomRenderer

Relevant log output

No response

@gubhit1s gubhit1s added the t/bug Something isn't working label Dec 16, 2023
@jsuarezruiz jsuarezruiz added area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/android 🤖 labels Dec 18, 2023
@PureWeen PureWeen added the good first issue Good for newcomers label Dec 18, 2023
@PureWeen PureWeen added this to the Backlog milestone Dec 18, 2023
@ghost
Copy link

ghost commented Dec 18, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@gubhit1s
Copy link
Author

Found a workaround for this, in case anyone facing the same issue:
protected override async void OnAppearing( { await Task.Delay(10); Shell.SetNavBarHasShadow(this, false); Shell.SetNavBarHasShadow(this, true); }

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jan 16, 2024
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.9.0 Preview 2(8.0.3 and 7.0.101). Repro on Android 14.0-API34, not repro on iOS 17.0 and MacCatalyst with below Project:
MauiApp1.zip

For Windows 11: The shadow under the title bar is always not displayed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout fixed-in-8.0.10 fixed-in-9.0.0-preview.2.10293 good first issue Good for newcomers platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Done
5 participants