android - React Native PixelRatio.get() returns a value outside the provided "buckets" for Nexus 5x -
based on react native documentation, pixelratio.get()
should return 1 of following values 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 nexus 5x density value 2.625
. expected? supposed manually manage values between basic ones or bug inside react native?
fyi, i'm using rn v0.24
react native deferring android density. android documentation explains well:
each generalized size , density spans range of actual screen sizes , densities. example, 2 devices both report screen size of normal might have actual screen sizes , aspect ratios different when measured hand. similarly, 2 devices report screen density of hdpi might have real pixel densities different.
android return actual density of device. there room manufacturers tweak this, it's not exact pixel density.
Comments
Post a Comment