小程序自定义标题栏

在APP.JSON里面设置

  "window": {   
      	"navigationStyle":"custom" 
         },

APP.wxss

.custom { 
 position: fixed; 
  width: 100%;
    top: 0; 
     left: 0; 
    height: 110rpx;  z-index: 999;  text-align: center;   line-height: 110rpx;   border-bottom: 1rpx solid rgb(220,220,220);   background: #ffffff;}
.custom text {  color: rgb(0,0,0);  font-size: 34rpx;  font-weight: 700;  max-width: 280rpx;  line-height: 110rpx;}
.empty_custom {  height: 110rpx;  width: 100%;}
#address{  display: flex;  position: absolute;  /* top: 57rpx; */  left: 20rpx; }#address image{  display: block;  vertical-align: middle;  margin-top: 46rpx;}#address .image_1{  width:23rpx;  height:24rpx;   margin-top: 43rpx;} #address .back_img{     width:30rpx;  height:35rpx;  }#address .image_2{  width:18rpx;  height:10rpx;  margin-top: 54rpx; }#address span{  font-size: 26rpx;  display: inline-block;  color: rgb(51,51,51);  padding: 0 5rpx;}

xhtml

<view class="custom flex_center" style="padding-top:{{statusBarHeight}}px;">  <view id='address'>    <image catchtap='back'  class='image_1 back_img' src='../../images/back.png'></image>  </view>  <text style=' line-height: 110rpx;'>职位管理</text></view><view class="empty_custom" style="padding-top:{{statusBarHeight}}px"></view>

app.js

    wx.getSystemInfo({      success: function (res) {        wx.setStorageSync('statusBarHeight', res.statusBarHeight)      }    })
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值