Reputation: 622
In react native app whats the best way to deal with font size.
I've a kind of weird issue, if font size is increased from mobile device display settings it changes the fontSize of app as well. I have used fontSize:14(whatever value), so it picks the size 14 according to mobile device font size & the font size of entire app get increased and UI looks horrible.
I've also tried to adjust the fontSize using width and height but it also not looks good on all devices.
const WIDTH = Dimensions.get('window').width;
const HEIGHT = Dimensions.get('window').height;
Upvotes: 7
Views: 4939
Reputation: 622
Adding allowFontScaling={false} to Text ignores the device font scaling.
<Text allowFontScaling={false} style={styles.TitleText}>
{this.state.testLabel.toUpperCase()}
</Text>
Upvotes: 3