uniapp中scroll-view去除滚动条

前言:

uniapp中我们使用scroll-view实现横向或者竖向滑动时,我们会发现横向或者竖向是有一个滚动条的,不是很美观,那么我们就可以尝试去去除一下滚动条(如果采用以下官方方法无法去除时,那么请向官方反馈信息)

一、scroll-view下的show-scrollbar属性

不过它默认是false,那就是本身不显示,可以忽略这个方法

二、app-plus属性下的scrollIndicator:none

代码

"scrollIndicator":"none"

三、通过css的-webkit-scrollbar自定义,包括隐藏滚动条

代码:

::-webkit-scrollbar{
    display: none;
    width: 0 !important;
    height: 0 !important;
    -webkit-appearance: none;
    background: transparent;
}

说明:可能在某个设备上还是有问题,等待官方小助手解决吧

猜你喜欢

转载自blog.csdn.net/bjt1015999/article/details/129229138