Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

Are there any alternatives to adjustsFontSizeToFit for Android?

$
0
0

I am using flex in Text field to display my values/range. For IOS I am using the properties adjustsFontSizeToFit and minimumFontScale props for Text to achieve the ideal font size and scaling. I want the same scaling to be enabled for Android. Does anyone use any tricks for Android?

<View style={{flex: 40}}>  {   (Platform.OS === 'ios') ?<Text style={{flex: 1, paddingRight: 2}} adjustsFontSizeToFit     minimumFontScale={0.5}>     //if decimal value exists show range     (pointFivePart_1 === '5') ? <Text style={{ flexDirection: 'row' }} ><Text style={styles.mainValueStyle}>{first_1}</Text><Text style=styles.decimalValueStyle}> .pointFivePart_1}</Text><Text style={styles.mainValueStyle}>&deg;</Text></Text>         : <Text style={styles.mainValueStyle} >{min}&deg;</Text>        }        //if two values then show the second value as range{// render largest value if different than min            (maxSet === minSet) ? null : (                (pointFivePart_2 === '5') ?<Text style={{ flexDirection: 'row' }} ><Text style={styles.mainValueStyle}> - {first_2}</Text><Text style={styles.decimalValueStyle}>.{pointFivePart_2}</Text><Text style={styles.mainValueStyle}>&deg;</Text></Text>                :<Text style={styles.mainValueStyle} > - {maxSet}&deg;</Text>                    )                }</Text>                :                //same styling for android

Viewing all articles
Browse latest Browse all 16552

Trending Articles