Skip to content

Commit

Permalink
fix(iOS): avoid cutting-off text on bottom bar buttons on iPad. (#7863)
Browse files Browse the repository at this point in the history
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..
  • Loading branch information
asafkorem authored Mar 20, 2024
1 parent 4b48f75 commit 9d627a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ios/RNNTabBarItemCreator.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -106,7 +106,7 @@ - (void)appendTitleAttributes:(UITabBarItem *)tabItem
fontSize:fontSize
fontWeight:fontWeight
color:selectedTextColor
centered:NO];
centered:YES];
[self setSelectedTitleAttributes:tabItem selectedTitleAttributes:selectedAttributes];
}

Expand Down

0 comments on commit 9d627a9

Please sign in to comment.