【发布时间】:2019-03-27 06:14:01
【问题描述】:
大家好,我正在使用const {width,height} = Dimensions.get('window');
根据屏幕宽度大小调整我的字体。
像这样使用....
fontSize:width/24
它在 iPhone 和 android 设备(如 5.5 英寸设备)中看起来不错,但在我的 Galaxy s9 中看起来很糟糕,我想根据屏幕设置字体,可以自行调整.. 我该怎么做呢
【问题讨论】:
-
我认为这个库是缩放github.com/vitalets/react-native-extended-stylesheet的最佳选择
-
一种选择是使用
rem或em代替 px 作为您的字体大小
标签: css react-native react-native-android react-native-ios