【微信小程序】解決 豎向 組件 “豎向滾動頁面出現遮擋”問題


問題圖:

問題原因:

  <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