From 9d627a9832f70ee274256486a0453dd8a75045b4 Mon Sep 17 00:00:00 2001 From: Asaf Korem <55082339+asafkorem@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:09:40 +0200 Subject: [PATCH] fix(iOS): avoid cutting-off text on bottom bar buttons on iPad. (#7863) 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 d313bfc7ee0..10d4b615a4e 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]; }