Shell TitleView disappearing on tab change
See original GitHub issueDescription
On iOS Simulator with Shell.FlyoutBehavior=“Flyout” and Tabs, Shell.TitleView is disappearing on tab change.
Steps to Reproduce
-
Create new .Net MAUI project.
-
Add couple ContentPages.
-
Add “AppTitleView” ContentView
-
Edit AppShell.xaml to set Shell.FlyoutBehavior=“Flyout”
-
Create couple FlyoutItem with Tab elements.
-
Add
<Shell.TitleView> <shellTitleView:AppTitleView /> </Shell.TitleView>
to Content Pages -
Run application, switch from “Tab 1” to “Tab 2”
-
Pages on the “Tab 1” will not show “Shell.TitleView”, but if you named that TitleView control it still accesable from code behind.
-
Simple project to demostrate the behavior: https://github.com/belmonmi/ShellTitleView
Version with bug
6.0.408
Last version that worked well
Unknown/Other
Affected platforms
iOS, I was not able test on other platforms
Affected platform versions
iOS 15.5
Did you find any workaround?
No
Relevant log output
2022-08-26 12:20:38.115611-0500 ShellTitleView[10063:986797]
Options:
2022-08-26 12:20:38.115788-0500 ShellTitleView[10063:986797] --bool-flag (Example)
type: bool default: false
2022-08-26 12:20:38.115883-0500 ShellTitleView[10063:986797] --aot-lazy-assembly-load (Load assemblies referenced by AOT images lazily)
type: bool default: false
Resolved pending breakpoint for 'ShellTitleView.Program.Main(System.String[])' to C:\Projects\iNet6\Mobile\Test\Issues\ShellTitleView\ShellTitleView\Platforms\iOS\Program.cs:10 [0x00000].
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:419 [0x00000].
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:414 [0x00000].
2022-08-26 12:20:40.312306-0500 ShellTitleView[10063:986797] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=10063
2022-08-26 12:20:40.312590-0500 ShellTitleView[10063:986797] SecTaskCopyDebugDescription: ShellTitleView[10063]/0#-1 LF=0
2022-08-26 12:20:40.319471-0500 ShellTitleView[10063:986797] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=10063
2022-08-26 12:20:40.319731-0500 ShellTitleView[10063:986797] SecTaskCopyDebugDescription: ShellTitleView[10063]/0#-1 LF=0
Thread started: #2
Thread started: #3
Thread started: #4
2022-08-26 12:20:41.484090-0500 ShellTitleView[10063:986797] [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <_UIMoreListTableView: 0x7fa4daef2c00; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600002e14330>; layer = <CALayer: 0x600002415140>; contentOffset: {0, 0}; contentSize: {0, 0}; a
djustedContentInset: {0, 0, 0, 0}; dataSource: <UIMoreListController: 0x7fa4d9fa97c0>>
Thread started: .NET Timers #5
Thread started: <Thread Pool> #6
Thread started: .NET ThreadPool Gate #7
Thread started: <Thread Pool> #8
Thread started: <Thread Pool> #9
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
Thread started: <Thread Pool> #14
2022-08-26 12:20:45.960535-0500 ShellTitleView[10063:986829] Warning: observer object was not disposed manually with Dispose()
2022-08-26 12:20:45.960790-0500 ShellTitleView[10063:986829] Warning: observer object was not disposed manually with Dispose()
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:17 (1 by maintainers)
Top Results From Across the Web
Maui: Why the content inside the Shell.TitleView ...
Here is a workaround. The problem with the disappearing of the TitleView does not happen, when you reorganise the menu navigation.
Read more >Every other tab in Shell doesn't show Shell.TitleView on ...
Hello, I have a pure MAUI app which targets only Android. This are the contents my Shell.xaml file:
Read more >Maui navigation and TitleView is very confusing
The button shows when the app loads but as soon as I go to another page it disappears and the TitleView seems to...
Read more >Why does the .net maui title bar disappear on iOS when ...
When you tap in the search box, the virtual keypad appears, but the shell.titleview disappears. (The same thing happens with the standard ...
Read more >Customize the Title Bar of a MAUI app with these simple steps
In a MAUI Shell app, we can access and control the style of the navigation bar in the root of any ContentPage. In...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @belmonmi @borrmann ,
I fixed the issue by using a custom render for AppShell on iOS.
I hope this helps others as well! Thank you
Thank you, works like a charm! Just had to use my inherited class from Shell, in my case
AppShell
in MauiProgram.csAlso I would suggest to set the Backgroundcolor using a saved status, so stuff like AppThemeBinding should still work