问题描述
我目前正在开发React Native应用程序,我们的一些用户可能会有轻微的视力问题.我们希望避免在Android中设置显示尺寸",因为这会使我们的应用无法使用.
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?
预先感谢
推荐答案
您可以在视图中控制使用flex属性.使用下面的到父视图,并将flex值从0.1调整为1以调整视图.下面是70%屏幕尺寸的示例.
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>
这篇关于React Native-禁用“屏幕尺寸"环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!