wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.04k stars 2.67k forks source link

Disable iOS 18 TabBar for Ipad #7926

Open anduong96 opened 1 month ago

anduong96 commented 1 month ago

Describe your idea

Disable ios 18 tabbar for ipad

Motivation

Ios 18 introduced a new tab bar UI that overwrites the bottom tab UI

This disable that

diff --git a/node_modules/react-native-navigation/lib/ios/RNNBottomTabsController.m b/node_modules/react-native-navigation/lib/ios/RNNBottomTabsController.m
index 2de2f0f..3658579 100644
--- a/node_modules/react-native-navigation/lib/ios/RNNBottomTabsController.m
+++ b/node_modules/react-native-navigation/lib/ios/RNNBottomTabsController.m
@@ -68,6 +68,12 @@ - (void)viewWillAppear:(BOOL)animated {

 - (void)viewDidLoad {
     [super viewDidLoad];
+    
+    if (@available(iOS 18.0, *)) {
+        if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+            self.traitOverrides.horizontalSizeClass = UIUserInterfaceSizeClassCompact;
+        }
+    }
 }

 - (void)createTabBarItems:(NSArray<UIViewController *> *)childViewControllers {

Are you willing to resolve this issue by submitting a Pull Request?

manuhook commented 1 month ago

Thank you very much