问题
I am currently developing a React Native application, and some of our users might have slight vision problems. We wish to prevent the setting "Display Size" in Android, as this makes our app unusable.
We solved the problem with the Font Size using the simple line:
Text.defaultProps.allowFontScaling=false;
Is there a similar solution to the Display Size setting?
Thanks in advance
回答1:
You can control using flex property in view. Use to below to the parent view and adjust the flex value from 0.1 to 1 to adjust the view. below is the example for 70% of the screen size.
<View style={{ flex : 0.7 }}>
</View>
来源:https://stackoverflow.com/questions/50738203/react-native-disable-screen-size-setting