1.首先在.json文件中进行配置;
{
"navigationBarTitleText": "导航栏自定义~",
"navigationStyle":"custom",
"usingComponents": {
}
}
2.页面.wxml
<view class="custom_head" style="height:{
{globalData.navHeight+5}}px;">
<view class="flex-row j_b" style="height:{
{globalData.navObj}}px;padding-top:{
{globalData.navTop+5}}px;padding-right:{
{globalData.navObjWid+5}}px;margin-left: 15px; ">
<image src="/assets/img/home/dingwei.png" mode="heightFix" style="width: 38rpx;height: 38rpx;vertical-align:top;" />
<text class="locationFont" >西北大学第一医院</text>
</view>
</view>
3.对应的js
const app = getApp()
Page({
data{
//取到自己定义的高度
cust