react native responsive fontSize
v0.5.1

如果字体尺寸有小问题,请使用此库?
yarn add react-native-responsive-fontsize
# or
npm install react-native-responsive-fontsize --save| iPhone SE | iPhone X |
|---|---|
| 争论 | 描述 | |
|---|---|---|
| rfpercentage | 百分比:数字 | 字体尺寸计算为设备的高度(以景观模式为width )的百分比。 |
| rfvalue | 价值:数字,标准屏幕高?:编号 | 字体尺寸是根据标准屏幕划分计算的,并通过了值 |
RFValue的standardScreenHeight680screen width import { RFPercentage , RFValue } from "react-native-responsive-fontsize" ;
const styles = StyleSheet . create ( {
welcome : {
fontSize : RFValue ( 24 , 580 ) // second argument is standardScreenHeight(optional),
textAlign : "center" ,
margin : 10 ,
} ,
instructions : {
textAlign : "center" ,
color : "#333333" ,
marginBottom : 5 ,
fontSize : RFPercentage ( 5 ) ,
} ,
} ) ; 发行
test code