dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.22k stars 1.75k forks source link

Shell navigation with modal page does not show title view #21321

Open dk-mushiyoke opened 7 months ago

dk-mushiyoke commented 7 months ago

Description

When using shell navigation to display a modal page, the title view does not show even with Shell.NavBarIsVisible set to True

As per #15498 the same issue should have been fixed in 8.0.0-preview.7.8842, however I am able to reproduce both in 8.0.6 and 8.0.7

Steps to Reproduce

  1. New maui project
  2. Add a new page with Shell.NavBarIsVisible="True" and Shell.PresentationMode="ModalAnimated"
  3. Register route for new page ("ModalPage" in repro)
  4. Hook up MainPage button clicked event to execute Shell.Current.GoToAsync("ModalPage");
  5. Build and run in android emulator, click button and observe the modal page

Link to public reproduction project repository

https://github.com/dk-mushiyoke/MauiModalTitleViewRepro

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.0-preview.7.8842

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

Using INavigation.PushModalAsync(new NavigationPage(new ModalPage())); instead of using shell navigation

Relevant log output

No response

ninachen03 commented 7 months ago

Verified this issue with Visual Studio 17.10.0 Preview 2. and Microsoft.Maui.Controls: 8.0.20-nightly.10336+sha.d03a2c66aa-azdo.9265184. 8.0.10+0-sha.50a0144fa5-azdo.9223550, 8.0.3+2-sha.1ebb238ff3-azdo.8651303 all of them can repro

image

kimhongka commented 5 months ago

Im getting the same issue. I cannot believe this has not fixed untill now.

MAUI document shows only about using GoToAsync way for Shell navigation instesad of using the NavigationPage way.

I can see the Modal from Shell GoToAsync, does Not show Shell.TitleView, and also the Tabbar as well. The Tabbar not showing issue is from Xamarin. I cannot believe the two issues are still there. https://github.com/xamarin/Xamarin.Forms/issues/13477

I think I need to use PushModal way to see if it works with Navigation titleview.... I have migrated two XF apps to MAUI(Prism navigation) already and this is my third migration. This time I wanted to use Shell.

I can do workaround like adding Title as customView or template etc, but this is not ideal. Please fix this issue

kimhongka commented 4 months ago

Any update? I ended up adding a custom view as the titleview in Grid. I reported bugs during the transition from Xamarin.Forms (XF) to .NET MAUI. None of them have been fixed even though they can be easily reproduced.

killer-frog commented 3 months ago

Is there any update on this issue? I'm struggling with this too!

rodrigoavots commented 2 months ago

I'm also having this problem, any solution?