当前位置:网站首页>微信小程序,自定义输入框与导航胶囊对其

微信小程序,自定义输入框与导航胶囊对其

2022-08-10 14:15:00 _Lan

介绍:

获取导航胶囊的信息,有两个事件,wx.getSystemInfoSync()wx.getMenuButtonBoundingClientRect()(注意这里不能使用rpx,只能使用px)。

状态栏高度:wx.getSystemInfoSync(),使用statusBarHeight

胶囊高度:wx.getMenuButtonBoundingClientRect(),使用返回的height

导航栏高度计算:(胶囊top-状态栏高度)*2 + 胶囊高度。

 

原网站

版权声明
本文为[_Lan]所创,转载请带上原文链接,感谢
https://blog.csdn.net/LiXiao_Lan/article/details/126157060