小程序自定义导航栏

将app.json里的navigationStyle设置为navigationStyle:custom。可以在.wxss里通过margin和padding来自定义导航栏。

例如在.wxml里写
<view class="nav">我是汽车维修技师</view>
在.wxss里设置样式
.nav{height:90rpx;line-height: 90rpx;margin-top:60rpx;padding-left:20rpx;font-size:28rpx;font-weight:400}
学习链接:
https://developers.weixin.qq.com/miniprogram/dev/framework/config.html#全局配置
https://www.caiyunyi.com/news/blog/25.html

猜你喜欢

转载自www.cnblogs.com/studyh5/p/9823459.html