uniapp 小程序全屏的实现

通过设置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
			
		},

  

原文地址:https://www.cnblogs.com/guiyishanren/p/14135357.html