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
			
		},

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM