【uniapp】scroll-view+sticky滚动加吸顶的高度设置

357 阅读1分钟

image.png 当sticky元素与scroll-view同级时。scroll-view的高度设置需要减去sticky元素的高度。如果有原生导航栏的话,h5需要减去原生导航栏,app不减去原生导航栏高度

.list-scroll{
        height: calc(100vh - 120rpx - 88rpx);
        // #ifdef APP-PLUS
        height: calc(100vh - 120rpx);
        // #endif
    }