uni-app scrollview refresh高度异常

uni-app scrollview refresh高度异常

2 回复


更多关于uni-app scrollview refresh高度异常的实战教程也可以访问 https://www.itying.com/category-93-b0.html


在uni-app中,scroll-view组件的下拉刷新高度异常通常是由于refresher-threshold属性设置不当或组件嵌套问题导致的。以下是常见原因及解决方案:

  1. 检查refresher-threshold

    • 该属性控制触发刷新的下拉距离,单位是px。若设置过大,可能导致下拉区域高度异常。
    • 建议根据需求调整,例如设置为80(默认值为45):
      <scroll-view refresher-threshold="80" ...>
      
  2. 避免嵌套滚动冲突

    • scroll-view外层存在其他滚动容器(如页面滚动),可能引发高度计算错误。
    • 可通过在页面配置中禁用页面滚动:
      { "path": "xxx", "style": { "disableScroll": true } }
回到顶部