Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Navbar] 与原生标题栏错位 #2624

Closed
EricGG-0 opened this issue Mar 5, 2024 · 2 comments · Fixed by #2626
Closed

[Navbar] 与原生标题栏错位 #2624

EricGG-0 opened this issue Mar 5, 2024 · 2 comments · Fixed by #2626

Comments

@EricGG-0
Copy link

EricGG-0 commented Mar 5, 2024

tdesign-miniprogram 版本

1.2.8

重现链接

No response

重现步骤

json文件
"usingComponents": { "t-navbar": "tdesign-miniprogram/navbar/navbar" }
wxml 文件
<t-navbar t-class="nav-title" title="XXXX"></t-navbar>

期望结果

与原生标题栏高度一致
image

实际结果

与原生标题栏有偏差,位置下移了
image

基础库版本

3.3.3

补充说明

查看了源代码,是因为拿到了右上角胶囊的位置后 强制乘以 2 转 rpx 导致的,实际无需这样操作,wx.getSystemInfoSync().statusBarHeight和 wx.getMenuButtonBoundingClientRect() 返回的均为 px 单位,而 px 转 rpx 是要根据屏幕像素计算的,不是乘以 2就是 rpx 了

image

Copy link
Contributor

github-actions bot commented Mar 5, 2024

👋 @EricGG-0,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@EricGG-0
Copy link
Author

EricGG-0 commented Mar 6, 2024

什么时候发布?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant