1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Try to fix font size does not adapat

This commit is contained in:
Zhiyuan Zheng
2021-03-10 11:49:14 +01:00
parent 5281de63a6
commit 9c3a300972
7 changed files with 25 additions and 17 deletions

View File

@ -0,0 +1,13 @@
import { Dimensions } from 'react-native'
const { width } = Dimensions.get('screen')
const guidelineBaseWidth = 375
// const guidelineBaseHeight = 667
const scale = (size: number) => (width / guidelineBaseWidth) * size
// const verticalScale = (size: number) => (height / guidelineBaseHeight) * size
const adaptiveScale = (size: number, factor: number = 0) =>
size + (scale(size) - size) * factor
export { adaptiveScale }