Fork me on GitHub

微信小程序 scroll-view bindrefresherrefresh 无法下拉刷新问题

当出现bindrefresherrefresh 方法拉不动无法触发下拉刷新的问题的时候基本都是scroll-view 的高度设定的问题,

需要在scroll-view 添加 wx:if="{{scrollHeight}}" 判断一下当有scrollHeight高度后再渲染scroll-view

scrollHeight 是在js里面获取的scroll-view的高度。

还有一种可能是添加一下

scroll-y="true"
 
<scroll-view 
refresher-triggered="{{isRefresh}}"
refresher-enabled="{{true}}"
style="height: {{scrollHeight}}px;"
scroll-y="true"
wx:if="{{scrollHeight}}"
bindrefresherrefresh="refresh">
 
 
在这里写个小技巧吧
scroll-view 的css里面添加以下三行代码可以自动减去苹果底部Dock栏高度
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
posted @ 2023-06-02 15:33  平凡的不平凡  阅读(1216)  评论(0编辑  收藏  举报
AmazingCounters.com