From bd614274484c7fa0fd7fac008c551932613b75b3 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Thu, 7 Nov 2024 06:22:58 -0600 Subject: [PATCH] Disable NSToolbar Tabs (#25137) (#25700) * Disable NSToolbar Tabs * - fix OS check * - fix tabbedview extentions PR * - bump targets * - add missing file * - add if/def for NET18.0 target * - add catalyst check * - switch to newer APIs for iOS and catalyst 18+ * - if/def for iOS18 # Conflicts: # src/Core/src/Platform/iOS/TabbedViewExtensions.cs --- .../Handlers/Shell/iOS/ShellItemRenderer.cs | 9 ++++++++- src/Core/src/Platform/iOS/TabbedViewExtensions.cs | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs index 48bc62a05ec2..ff509574fd5f 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs @@ -439,7 +439,14 @@ void UpdateTabBarHidden() if (ShellItemController == null) return; - TabBar.Hidden = !ShellItemController.ShowTabs; + if (OperatingSystemMacCatalyst18Workaround.IsMacCatalystVersionAtLeast18() || OperatingSystem.IsIOSVersionAtLeast(18)) + { + TabBarHidden = !ShellItemController.ShowTabs; + } + else + { + TabBar.Hidden = !ShellItemController.ShowTabs; + } } } } diff --git a/src/Core/src/Platform/iOS/TabbedViewExtensions.cs b/src/Core/src/Platform/iOS/TabbedViewExtensions.cs index 103079ed585b..61be9c0dfc4b 100644 --- a/src/Core/src/Platform/iOS/TabbedViewExtensions.cs +++ b/src/Core/src/Platform/iOS/TabbedViewExtensions.cs @@ -17,8 +17,6 @@ internal static void DisableiOS18ToolbarTabs(this UITabBarController tabBarContr { tabBarController.TraitOverrides.HorizontalSizeClass = UIUserInterfaceSizeClass.Compact; tabBarController.Mode = UITabBarControllerMode.TabSidebar; - tabBarController.Sidebar.Hidden = true; - tabBarController.TabBarHidden = true; } else if (OperatingSystem.IsIOSVersionAtLeast(18, 0) && UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {