Skip to content

Commit bd61427

Browse files
authored
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
1 parent 6f1322b commit bd61427

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellItemRenderer.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,14 @@ void UpdateTabBarHidden()
439439
if (ShellItemController == null)
440440
return;
441441

442-
TabBar.Hidden = !ShellItemController.ShowTabs;
442+
if (OperatingSystemMacCatalyst18Workaround.IsMacCatalystVersionAtLeast18() || OperatingSystem.IsIOSVersionAtLeast(18))
443+
{
444+
TabBarHidden = !ShellItemController.ShowTabs;
445+
}
446+
else
447+
{
448+
TabBar.Hidden = !ShellItemController.ShowTabs;
449+
}
443450
}
444451
}
445452
}

src/Core/src/Platform/iOS/TabbedViewExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ internal static void DisableiOS18ToolbarTabs(this UITabBarController tabBarContr
1717
{
1818
tabBarController.TraitOverrides.HorizontalSizeClass = UIUserInterfaceSizeClass.Compact;
1919
tabBarController.Mode = UITabBarControllerMode.TabSidebar;
20-
tabBarController.Sidebar.Hidden = true;
21-
tabBarController.TabBarHidden = true;
2220
}
2321
else if (OperatingSystem.IsIOSVersionAtLeast(18, 0) && UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
2422
{

0 commit comments

Comments
 (0)