From aab60a6f1be663db56a7df2d96bee4d25dba3614 Mon Sep 17 00:00:00 2001 From: Asaf Korem Date: Wed, 20 Mar 2024 18:15:18 +0200 Subject: [PATCH] fix(iOS): avoid cutting-off text on bottom bar buttons on iPad. For some reason, this change resolves the issue in the attached snapshots. When `centered=YES`, setting the text alignment to `NSTextAlignmentCenter` may incidentally cause the text layout engine to more effectively manage the available space. Doesn't seem like it affects anything in iPhones. Overall, it seems like a bug in UIKit.. --- lib/ios/RNNTabBarItemCreator.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ios/RNNTabBarItemCreator.m b/lib/ios/RNNTabBarItemCreator.m index d313bfc7ee..10d4b615a4 100644 --- a/lib/ios/RNNTabBarItemCreator.m +++ b/lib/ios/RNNTabBarItemCreator.m @@ -97,7 +97,7 @@ - (void)appendTitleAttributes:(UITabBarItem *)tabItem fontSize:fontSize fontWeight:fontWeight color:textColor - centered:NO]; + centered:YES]; [self setTitleAttributes:tabItem titleAttributes:normalAttributes]; NSDictionary *selectedAttributes = [RNNFontAttributesCreator @@ -106,7 +106,7 @@ - (void)appendTitleAttributes:(UITabBarItem *)tabItem fontSize:fontSize fontWeight:fontWeight color:selectedTextColor - centered:NO]; + centered:YES]; [self setSelectedTitleAttributes:tabItem selectedTitleAttributes:selectedAttributes]; }