react-native-navigation
react-native-navigation copied to clipboard
Android support topbar title font scaling
- Android only
- To enable font scaling that can be adjusted via Android Settings-app:
-
Accessibility -> Display size and text -> Font size
-
- Adds options.topBar.title.allowFontScaling
- Adds and updated unit tests
- When allowFontScaling is enabled, sets top bar title to use SP units. When font scaling is 1.0, it should be the same size as when using DIP
- Here it's set to false by default, because it can conflict with other top bar options like subtitle, height, fontSize etc. that existing users may have
- I'm thinking about making similar changes to iOS, but I wanted feedback on this one first. iOS has some issues especially when "Larger accessibility sizes"-setting is enabled
{
topBar: {
title: {
text: "My title",
fontSize: 18,
allowFontScaling: true,
},
},
}
| allowFontScaling=false | allowFontScaling=true |
|---|---|