赞
踩
思路首先开启自定义导航栏,取消自带的导航栏,然后计算胶囊的高度和标题对齐
- <view class="header"
- :style="{paddingTop:navBarTop + 'px',height:navBarHeight + 'px',lineHeight:navBarHeight + 'px'}">
-
-
- </view>
- data(){
-
- return{
- navBarTop: null,
- navBarHeight: null,
- }
- }
-
- onLoad() {
- let statuBar = uni.getSystemInfoSync().statusBarHeight;
- let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
- console.log(menuButtonInfo)
- this.navBarTop = menuButtonInfo.top;
- this.navBarHeight = menuButtonInfo.height;
-
- },
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。