Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bottom tabs text is cut off on iPad #7855

Closed
1 task done
d4vidi opened this issue Feb 25, 2024 · 6 comments · Fixed by #7863
Closed
1 task done

Bottom tabs text is cut off on iPad #7855

d4vidi opened this issue Feb 25, 2024 · 6 comments · Fixed by #7863

Comments

@d4vidi
Copy link
Collaborator

d4vidi commented Feb 25, 2024

What happened?

Complete info: WOARNN-568

The text in some of the bottom tabs is cut off -

image

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

  • I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

No response

In what environment did this happen?

React Native Navigation version:
React Native version:
Has Fabric (React Native's new rendering system) enabled: (yes/no)
Node version:
Device model:
iOS version:

@phuongwd
Copy link

phuongwd commented Mar 8, 2024

Related to

  1. Text In bottom bar has been cutoff in iPad 12.9 inch (ios 15.4) #7506
  2. Text in bottom bar is cut off in ipad #7827

Patch

diff --git a/node_modules/react-native-navigation/lib/ios/RNNTabBarItemCreator.m b/node_modules/react-native-navigation/lib/ios/RNNTabBarItemCreator.m
index d313bfc..c22f984 100644
--- a/node_modules/react-native-navigation/lib/ios/RNNTabBarItemCreator.m
+++ b/node_modules/react-native-navigation/lib/ios/RNNTabBarItemCreator.m
@@ -91,13 +91,19 @@
     NSNumber *fontSize = [bottomTabOptions.fontSize withDefault:@(10)];
     NSString *fontWeight = [bottomTabOptions.fontWeight withDefault:nil];
 
+    /**
+     * The title of tabbar item has been cut off in iPad 12.9 with iOS 15.4.
+     * It was mentioned at https://github.com/wix/react-native-navigation/issues/7506
+     * Hotfix: centered the text will resolve problem.
+     */
+
     NSDictionary *normalAttributes = [RNNFontAttributesCreator
         createFromDictionary:[tabItem titleTextAttributesForState:UIControlStateNormal]
                   fontFamily:fontFamily
                     fontSize:fontSize
                   fontWeight:fontWeight
                        color:textColor
-                    centered:NO];
+                    centered:TRUE];
     [self setTitleAttributes:tabItem titleAttributes:normalAttributes];
 
     NSDictionary *selectedAttributes = [RNNFontAttributesCreator
@@ -106,7 +112,7 @@
                     fontSize:fontSize
                   fontWeight:fontWeight
                        color:selectedTextColor
-                    centered:NO];
+                    centered:TRUE];
     [self setSelectedTitleAttributes:tabItem selectedTitleAttributes:selectedAttributes];
 }

@asafkorem
Copy link
Collaborator

Thanks for the patch suggestion @phuongwd, I will check that now 🙂

@asafkorem
Copy link
Collaborator

Fix is here: #7863, will release a patch version soon

@phuongwd
Copy link

phuongwd commented Mar 20, 2024

Thanks for the patch suggestion @phuongwd, I will check that now 🙂

Credit to thuongtv-vn #7506 (comment)

@asafkorem
Copy link
Collaborator

The fix will be released in the next patch version. @phuongwd you will both get credit in the release notes 😄

@asafkorem
Copy link
Collaborator

Released with 7.38.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants