[Mini Program] 尺寸单位 rpx

So each phone's width is 750rpx. And according to the device ratio (width:height), we can calucalate the height in rpx.

For example

iPhone 5: 320px x 568px, 320px = 750rpx,  therefore 1rpx = 0.42px. So the height of iPhone5 is 568 / 0.42 = 1352rpx.

iPhone X: 375px x 812px, 375px = 750rpx, therefore 1rpx = 0.5px. So the height of iPhone X is 812 / 0.5 = 1624rpx.

猜你喜欢

转载自www.cnblogs.com/Answer1215/p/9264779.html