Giter Club home page Giter Club logo

Comments (2)

18148764734 avatar 18148764734 commented on June 2, 2024

感谢反馈,排查出问题是开启skyline必须要设置自定义导航栏,而自定义导航栏如果没有自行配置的话,就会出现内容被顶到导航栏上面,需要自行添加顶部的padding或者margin.可参考以下代码进行修正位置:

onReady() {
			const renderer = false // true for skyline, false for webview
			const pages = getCurrentPages()
			const page = pages[pages.length - 1]
			console.log(page.renderer)
			//判断是否是skyline渲染
			if (page.renderer === "skyline") {
				let {
					statusBarHeight
				} = uni.getSystemInfoSync(); // 当前设备信息
				let {
					height,
					top
				} = uni.getMenuButtonBoundingClientRect(); // 胶囊状态信息

				// 自定义标题栏的高度 = 
				// 状态栏的高度 + 
				// 状态栏与标题栏之间的缝隙(根据设备不同乘上对应的比值) + 
				// 胶囊的高度
				this.marginTop = (statusBarHeight + (top - statusBarHeight) * 2 + height) + 'px';
			}
		},

from uni-ui.

18148764734 avatar 18148764734 commented on June 2, 2024

已更新回复,请参考楼上的问题分析

from uni-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.