import {
    Dimensions,
    PixelRatio
} from 'react-native';
//视屏的宽度和设置像素转换
const deviceWidthDp = Dimensions.get('window').width;

const uiWidthPx = 750;

function pxToDp(uiElementPx,isConvert = true) {
  if(!isConvert) return uiElementPx;
  return Number((uiElementPx *  deviceWidthDp / uiWidthPx));
}
export default pxToDp