淮安企業(yè)網(wǎng)站搜一搜
如果我們有一個(gè)區(qū)域有限的大盒子(黑),而我們要在盒子中裝的東西(灰)過多,我們就會(huì)用到滾動(dòng)視圖:
表現(xiàn)在代碼上就是下面這個(gè)樣子:
<template><view class="scrollView"><view class="box">box</view><view class="box">box</view><view class="box">box</view><view class="box">box</view><view class="box">box</view><view class="box">box</view></view>
</template>
scroll-view有許多屬性,下面介紹一些常用的屬性。
一、允許縱向滾動(dòng)
scroll-y? ? 允許縱向滾動(dòng)
二、允許橫向滾動(dòng)
scroll-x? ? 允許橫向滾動(dòng)
注意這里的CSS樣式設(shè)置,需要把scroll-view中的元素排成一排。?
?