UNPKG

mh-rn-component

Version:

9 lines (8 loc) 355 B
import { Dimensions } from 'react-native'; // 这里我只配置了 375的设计稿 // 这个方案 可能会需要增加一个递归。直接return StyleSheet export const dp = uiElePx => { const deviceWidthDp = Dimensions.get('window').width; const uiWidthPx = 375; return uiElePx * deviceWidthDp / uiWidthPx; }; //# sourceMappingURL=index.js.map