【小程序】微信小程序取消全局或单个页面的标题栏

1、取消全部标题栏:
在app.json里的window加上:navigationStyle:custom 。顶部导航栏就会消失,保留右上角胶囊状的按钮

  "window": {
    
    
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#444",
    "navigationBarTitleText": "古诗猜谜",
    "navigationBarTextStyle": "white",
    "navigationStyle": "custom"
  },

2、取消单个页面标题栏:
在某个页面的.json文件里加上"navigationStyle": “custom”


{
    
    
  "usingComponents": {
    
    },
  "navigationStyle": "custom"
}

相关小程序例子:
![在这里插入图片描述](https://img-blog.csdnimg.cn/89ccba83e9474b69b352a50372e314a1.png

页面:自定义标题以及设置全局背景图

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/LuviaWu/article/details/118091112
今日推荐