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