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 | ค่า: หมายเลข, มาตรฐานหน้า?: จำนวน | ขนาดตัวอักษรถูกคำนวณตามมาตรฐานสกรูนไฮต์และค่าที่ผ่าน |
standardScreenHeight ของ RFValue680screen 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