本来设置scrollview 高度为950rpx
换了多种机型发现大手机下面少了一截
后面参考了网上的
https://blog.csdn.net/jifashihan/article/details/105794067
onReady:function(){
//scroll高度自适应
let windowHeight = wx.getSystemInfoSync().windowHeight // 屏幕的高度
let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
let ratio = 750 / windowWidth;
let tabheight= 100/ratio //比作者多加了一条因为我上面还有个tab高度按照rpx算的,需要逆运算
this.setData({
scroll_height: (windowHeight - tabheight) * ratio
})
},
写在onready中,再适合不过了