uniapp小程序自定义标题栏

首先在page页面中配置 “navigationStyle”: “custom”

			"path": "pages/index/index",
			"style": {
				"navigationStyle": "custom",
				"enablePullDownRefresh": false
			}

页面中

<view class="header" :style="{paddingTop:paddingTop + 'px',height:height + 'px',lineHeight:height + 'px'}">
	自定标题栏
</view>

onLoad() {
	//设置导航条参数
	let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
	this.paddingTop = menuButtonInfo.top
	this.height = menuButtonInfo.height
},

你可能感兴趣的:(uni-app,小程序)