1.0.1 • Published 2 years ago

react-native-exact-ratio v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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

ExampleImage

MIT Licensed