小程序里使用scroll-view,然后發(fā)現(xiàn)在iOS下不能滾動,在安卓下正常。
- 先確認scroll-y="true"
- 一定需要給scroll-view設置一個高度,具體的根據(jù)你自己的頁面來 ,可以getSystemInfo獲取可視區(qū)域的高度
const res = uni.getSystemInfo({
success:(res=>{
this.clientHeight = res.windowHeight - getApp().globalData.navHeight - 50;
})
});
- 給scroll-view加上判斷,最后是這樣的
<scroll-view v-if="clientHeight != 0" scroll-y="true" :style="{'height': clientHeight + 'px'}">