【微信小程序】解决 竖向组件 “竖向滚动页面出现遮挡”问题


问题图:

问题原因:

  <scroll-view class="scroll-container" upper-threshold="{{sortPanelDist}}"  scroll-y="true" style="height:{{scrollHeight}}px;" bindscrolltolower="bindDownLoad" bindscroll="scroll" bindscrolltoupper="refresh">

 

其中,style="height:{{scrollHeight}}px;"  属性设置不够,导致出现遮挡。

剖析:首页没有出现这样,在其他tarbar页才出现。

解决:

  onLoad: function (options) {
    var that = this;
    //获取系统的参数,scrollHeight数值,微信必须要设置style:height才能监听滚动事件
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          scrollHeight: parseInt(res.windowHeight)+200
        })
      }
    });
  },

//给获取的系统高度,再加上200px

完美解决。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM