プロジェクト
概要
🔠 React Nativeでデバイスの画面サイズに応じて変化するレスポンシブなfontSize
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- -1
- 1か月
- -1
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナル
react-native-responsive-fontsize
Use this library if you have a small problem with the font size 🎉
How to install
yarn add react-native-responsive-fontsize
# or
npm install react-native-responsive-fontsize --save
How it looks on different device sizes
| iPhone SE | iPhone X |
|---|---|
![]() |
![]() |
Methods
| arguments | Description | |
|---|---|---|
| RFPercentage | percent: number | The font size is calculated as a percentage of the height(width in landscape mode) of the device. |
| RFValue | value: number, standardScreenHeight?: number | The font size is calculated based on standardScreenHeight and passed value |
- when using
RFValue'sstandardScreenHeight- default standardScreenHeight is
680 - In landscape mode, please pass the
screen width
- default standardScreenHeight is
Usage
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),
},
});
Changelog
Load map (I'm waiting for your help)
- support landscape mode
- make
test code
関連プロジェクトを探す
読み込み中…

