React Native - Disable “Screen Size” Setting

大城市里の小女人 提交于 2019-12-19 19:58:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!