方案1:直接使用微信小程序提供的 “ scroll-view " 組件。
<scroll-view scroll-y style="height: 100%;">
<!--你要滾動的內容-->
</scroll-view>
注意:必須要設置scroll-view的高度height
加了scroll-view之后,外出view需加上overflow:scroll,否則還是會被撐大,導致固定布局的位置有問題。
方案2:
view{ overflow:auto; -webkit-overflow-scrolling: touch; }
這種方法雖然可以讓列表滾動,但會伴隨副作用(比如fixed元素會跟隨滾動再恢復位置),不推薦