Based on the React Native documentation, PixelRatio.get()
should return one of the following values for the device pixel density:
- PixelRatio.get() === 1
mdpi Android devices (160 dpi)
- PixelRatio.get() === 1.5
hdpi Android devices (240 dpi)
- PixelRatio.get() === 2
iPhone 4, 4S
iPhone 5, 5c, 5s
iPhone 6
xhdpi Android devices (320 dpi)
- PixelRatio.get() === 3
iPhone 6 plus
xxhdpi Android devices (480 dpi)
- PixelRatio.get() === 3.5
Nexus 6
When calling PixelRatio.get()
on a Nexus 5x I get the density value 2.625
. Is the expected? Are we supposed to manually manage the values that are between the basic ones or is this a bug inside React Native?
FYI, I'm using RN v0.24