react-native-exact-ratio
v1.0.1
Published
Get exact pixel ratio of device
Downloads
321
Readme
react-native-exact-ratio
Get exact device density and ppi for React Native.
React Native build-in PixelRatio can get device density using PixelRatio.get(), but the return value has been rounded. This package will return the exact value of device density
Installation
npm install --save react-native-exact-ratio
Usage
import { DeviceRatio } from 'react-native-exact-ratio'
console.log('Device Density:', DeviceRatio.density)
console.log('Device DPI:', DeviceRatio.dpi)
Example
cd example
npm install && cd ios && pod install && cd ..
react-native run-ios