使用rpx2px在小程序能正常换算结果,在app上提示“TypeError: uni.rpx2px is not a function“,Android和iOS都会报错无法使用,这个api现在是无法在app上使用吗,HB版本为4.45

heartDay
- 发布:2025-02-25 14:22
- 更新:2025-02-25 15:17
- 阅读:28



爱豆豆 - 办法总比困难多
测试发现确实不能用
你可以先自己计算
200是rpx 750是基准宽度
(uni.getSystemInfoSync().screenWidth * Number.parseInt(200)) / 750
或者暂时用uni.upx2px(200) 这个api还能用
heartDay (作者)
好的
2025-02-25 15:45