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 | 値:番号、StandardSardsCreenHeight?:番号 | フォントサイズは、標準スクリーンハイトに基づいて計算され、値に合格します |
RFValueのstandardScreenHeightを使用する場合680ですscreen 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を作成します