I have problem with scaling font inside of View or better to say inside of Text component in React Native for Android. The problem is, I want to text inside of Text component automatically scale depends on length of string (if text can fit inside View with desired font size do nothing and if it's string too long for this font size set smaller font size).
For Example:
1.
<View style={{flexDirection: 'row'}}>
<Text numberOfLines={1} style={{fontSize: 20}}>This is in one row.</Text>
</View>
In this case (1.) text would render in one line with font size 22.
2.
<View style={{flexDirection: 'row'}}>
<Text numberOfLines={1} style={{fontSize: 20}}>This is in one row and much longer text inside of Text component.</Text>
</View>
In second (2.) scenario text would render in one line with ... at the end and also with font size 20. But, I want to font automatically scale down if content can't fit in one line of Text component.
I search for solution and I found that for iOS you can easily solve this problem with attributes inside Text as following:
<Text adjustsFontSizeToFit minimumFontScale={.4}>Automatically font scale</Text>
This isn't working for Android so I really need help :/
If someone knows how I can accomplish to font automatically change size to fit inside of Text in one line I would be very grateful.
Thank you in advance!