uniapp中,uni-list组件撑开页面的解决办法

文章探讨了在uni-app中使用uni-list组件时遇到的问题,即当设置margin-bottom属性后,会影响上方区域的高度。作者发现通过添加overflow:scroll属性到uni-list可以解决这个问题,但同时还在研究其他可能的影响和解决方案。
摘要由CSDN通过智能技术生成

 

<template>
    <view ref="parent"><view style="width: 100%;height: 100rpx;background-color: aqua;margin-bottom: 120rpx;">占位</view>
        <uni-list border="true" style="width: 100%;margin-bottom: 100rpx;overflow: scroll;">
            <uni-list-item style="width: 100%;" v-for="item,index in 12" :key="index" :title="'我是第'+index+'行'"
                note="adfasdfadfasdfasdf">

            </uni-list-item>
        </uni-list>
        <button
            style="width: 80%;position: fixed;bottom: 0%;background-color: chocolate;height: 80rpx;margin-bottom: 20rpx;">占位按钮</button>
    </view>
</template>

关键在于--》 <uni-list>中增加属性overflow: scroll;

存在的问题:<uni-list>中的属性margin-bottom,会导致占位1区域的高度被压缩,还在研究中。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值