react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Disable iOS 18 TabBar for Ipad

Open anduong96 opened this issue 4 months ago • 0 comments

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?

  • [ ] Yes, I have the time, and I know how to start.
  • [X] Yes, I have the time, but I don't know how to start. I would need guidance.
  • [ ] No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

anduong96 avatar Oct 17 '24 15:10 anduong96