get_height(){
let that = this
//获取手机屏幕的高度(px)
let result = wx.getSystemInfoSync()
let windowHeight = result.windowHeight
//创建节点查询对象
const query = wx.createSelectorQuery()
//查询上一个节点底部坐标
query.select('.category').boundingClientRect().exec(function(res){
//屏幕高度减去上个节点底部坐标,得到屏幕剩余高度
let height = windowHeight - res[0].bottom
that.setData({
scrollViewHeight:height
})
})
},
scroll-view适配屏幕高度
最新推荐文章于 2023-11-29 11:40:41 发布