Skip to content

Commit

Permalink
fix(iOS): avoid cutting-off text on bottom bar buttons on iPad.
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 committed Mar 20, 2024
1 parent 4b48f75 commit aab60a6
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 aab60a6

Please sign in to comment.