wx scroll-view的使用(與頁面滾動衝突)

<view class="tui-fixed-y">
<scroll-view class="tui-city-scroll-y" bindscroll="scroll" :scroll-into-view="toView" :scroll-y="true"
      :enable-back-to-top="true" :scroll-anchoring="true" :scroll-with-animation="true">

<-- 內容 -->

</scroll-view>
</view>


<style>

.tui-fixed-y {
    width: 100%;
    height: calc(100% - 80rpx);
    position: fixed;
    bottom: 0;
    top: 0;
    left: 0;
  }

.tui-city-scroll-y {
    height: 100%;
    box-sizing: border-box;
  }
</style>

當頁面內容過多產生滾動和scroll-view會產生衝突

解決辦法:

讓scroll-view包裹頁面所有內容

當需要懸浮導航欄的時候  監聽scroll-view的距離頂部的高度

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章