scroll-view中view嵌套大量小view后小view会超出来往下排
发布于 5 年前 作者 fqin 19012 次浏览 来自 问答

刚开始学,我在官方文档给的scroll-view例子中添加了几个view

<view class=“section__title”>vertical scroll</view>

    <scroll-view class=‘scrollview’ scroll-y style=“height: 400px;” bindscrolltoupper=“upper” bindscrolltolower=“lower” bindscroll=“scroll” scroll-into-view="{{toView}}" scroll-top="{{scrollTop}}">

        <view id=“green” class=“scroll-view-item bc_green”>

            //新添加的view↓

            <view class=‘aaa’>view</view>

            <view class=‘aaa’>view</view>

            <view class=‘aaa’>view</view>

            <view class=‘aaa’>view</view>

            //新添加的view↑

        </view>

    <view id=“red”  class=“scroll-view-item bc_red”></view>

    <view id=“yellow” class=“scroll-view-item bc_yellow”></view>

    <view id=“blue” class=“scroll-view-item bc_blue”></view>

</scroll-view>

我没给id=green的view设置固定高度,里面的class='aaa’的view如果太多会超出来

怎么能不设置固定高度,让id=green的view被撑起来,不会弄啊。。

回到顶部