代码片段:https://developers.weixin.qq.com/s/tZslJRmG7Sv5
iphoneX复现,正常:
红米K30复现,偏移:
文字无法居中,安卓IOS兼容?Text can’t be centered, compatible with Android and IOS?
文字无法居中,安卓IOS兼容?框架类型 | 问题类型 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|
小程序 | Bug | 微信iOS客户端 | 8.0.16 | 2.21.2 |
Framework type problem type terminal type wechat version basic library version applet bug wechat IOS client 8.0 16 2.21. 2 code snippet: https://developers.weixin.qq.com/s/tZslJRmG7Sv5 Iphonex reproduction, normal: red rice K30 reproduction, offset: code fragment https://developers.weixin.qq.com/s/tZslJRmG7Sv5
回答:
应该是系统字体的问题,字体本身上下留白高度不一样
目测跟你系统字体有关。
原文出处:文字无法居中,安卓IOS兼容?
因为你的container设置了行高
line-height