官方文件橫向滾動沒有效果?
<scroll-view class="scroll-view-con" scroll-x style="width: 100%">
<view id="green" class="scroll-view-item bc_green">1</view>
<view id="red" class="scroll-view-item bc_red">2</view>
<view id="yellow" class="scroll-view-item bc_yellow">3</view>
<view id="blue" class="scroll-view-item bc_blue">4</view>
</scroll-view>
複製程式碼
經過測試發現要想實現橫向滾動,還需要兩個條件
- scroll-view容器設定 white-space: nowrap
- 專案需要 display: inline-block