Object wx.getWindowInfo() 获取窗口信息

追格_咖小啡/ 2023年12月28日/ 小程序/ 浏览 1243

Object wx.getWindowInfo()是微信小程序获取窗口信息API。




示例代码:


const windowInfo = wx.getWindowInfo()
console.log(windowInfo.pixelRatio)
console.log(windowInfo.screenWidth)
console.log(windowInfo.screenHeight)
console.log(windowInfo.windowWidth)
console.log(windowInfo.windowHeight)
console.log(windowInfo.statusBarHeight)
console.log(windowInfo.safeArea)
console.log(windowInfo.screenTop)


发表评论

暂无评论,抢个沙发...

客服 工单