Scaling the font down

This is possible on iOS right now:

<Text    style={styles.text}    numberOfLines={1}    adjustsFontSizeToFit>    {this.state.likeCount}</Text>

But, the outcome is a complete disaster in our case. The layout feels very inconsistent, even if we put some work into this scaling solution:

Automatic font adjustment using the adjustsFontSizeToFit prop for iOS
As shown earlier in the book, you could use Dimensions instead of relying on adjustsFontSizeToFit. Based on Dimensions, you can create a scaling function to compute fontSize.

Get Hands-On Design Patterns with React Native now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.