使用scorll-view橫向拖動應該注意些什麼?
1.scroll-view 中的需要滑動的元素不可以用 float 浮動;
2.scroll-view 中的包裹需要滑動的元素的大盒子用 display:flex; 是沒有作用的;
3.scroll-view 中的需要滑動的元素要用 dislay:inline-block; 進行元素的橫向編排;
4.包裹 scroll-view 的大盒子有明確的寬和加上樣式–> overflow:hidden;white-space:nowrap;
<scroll-view class="scrollview-box" scroll-x="true">
<view>A</view>
<view>B</view>
<view>C</view>
</scroll-view>
使用scroll-view縱向拖動應該注意什麼?
scroll-view的高度必須確定,標籤上得有scroll-y屬性爲true
<scroll-view scroll-y="true" style="height:200rpx"></scroll-view>