From dd903e4706a41a4cb74db9261f6d3d1afc9e2f7f Mon Sep 17 00:00:00 2001 From: James Ide Date: Sat, 28 Nov 2026 02:40:19 -0800 Subject: [PATCH] Remove RNTester's bottom padding under the iPad's floating tab bar On iPad a floating tab bar along the top replaces the bottom tab bar. RNTester's tabs still counted the replaced bar as a bottom bar, because it is not hidden and keeps a full-width frame at the bottom edge, so the content got the 65-point bottom inset and the example list stopped short of the bottom of the screen. The replaced bar is not in a window, so only count a tab bar that is. Co-Authored-By: Claude Fable 5.2 --- .../RNTesterTabsIOS/ios/RNTesterTabsIOSComponentView.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/rn-tester/RNTesterTabsIOS/ios/RNTesterTabsIOSComponentView.mm b/packages/rn-tester/RNTesterTabsIOS/ios/RNTesterTabsIOSComponentView.mm index 8ea5809a7d4a..8d059bf430d3 100644 --- a/packages/rn-tester/RNTesterTabsIOS/ios/RNTesterTabsIOSComponentView.mm +++ b/packages/rn-tester/RNTesterTabsIOS/ios/RNTesterTabsIOSComponentView.mm @@ -217,8 +217,9 @@ - (void)tabSafeAreaInsetsDidChange:(UIEdgeInsets)insets { CGRect tabBarFrame = _tabBarController.tabBar.frame; CGRect bounds = _tabBarController.view.bounds; - BOOL hasBottomTabBar = !_tabBarController.tabBar.hidden && CGRectGetWidth(tabBarFrame) >= CGRectGetWidth(bounds) && - CGRectGetMaxY(tabBarFrame) >= CGRectGetMaxY(bounds); + // Where a floating tab bar along the top replaces it, as on iPad, the tab bar has no window. + BOOL hasBottomTabBar = _tabBarController.tabBar.window != nil && !_tabBarController.tabBar.hidden && + CGRectGetWidth(tabBarFrame) >= CGRectGetWidth(bounds) && CGRectGetMaxY(tabBarFrame) >= CGRectGetMaxY(bounds); if (hasBottomTabBar) { insets.top = MAX(insets.top, LegacyTopInset); // Never go below the system inset: anything less leaves content under the tab bar, where taps switch tabs.