react-native-normalize
react-native-normalize copied to clipboard
Normalize doesn't work on android
I'm using this package and it works perfectly on IOS but it doesn't work on android. Can someone help me ?
I had the same problem. I looked into the code and saw that on Android 2 pixels are being subtracted from the end result
if (Platform.OS === 'ios') {
return Math.round(PixelRatio.roundToNearestPixel(newSize));
} else {
return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
}
}
I removed subtraction and now normalization works fine.
But could someone explain why we are doing subtraction of 2 pixels? UPD: I also see I am not only one asking such question #5