通过设置navigationStyle, 即自定义导航实现背景全屏

 

参考文章:  微信小程序 自定义头部导航栏 navigationStyle

代码部分

在page.json中, 加入 "navigationStyle": "custom" , 这是全局的, 单页面的还不知道怎么搞


"globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "知识问答系统", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8", "navigationStyle": "custom" }

  

然后背景全屏代码部分, 首先需要容器占满屏幕

<view class="background" :style = ' { backgroundImage : " url(" + setting.login_background + " ) " } '>

  

 		onReady() {
			let systemInfo = uni.getSystemInfoSync()
			this.height = systemInfo.windowHeight
			
		},

  

 

相关文章:

  • 2023-01-10
  • 2021-11-17
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2021-07-14
  • 2021-11-14
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2023-03-16
  • 2020-06-09
相关资源
相似解决方案