uni-app 鸿蒙页面滚动条不隐藏

uni-app 鸿蒙页面滚动条不隐藏

“scrollIndicator”: “none” 设置这个在安卓app和苹果app上面是不会显示滚动条的 但是在鸿蒙上面还是会显示

看很多大哥都说最外层使用超出隐藏,max-width:100vw,max-height:100vh 这样确实是可以做到滚动条隐藏 但是onPageScroll这个页面滚动监听就用不了了

想问下有没有就是 “scrollIndicator”: “none” 这种效果的

1 回复

更多关于uni-app 鸿蒙页面滚动条不隐藏的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


在鸿蒙系统上,scrollIndicator: "none" 确实存在兼容性问题。目前可以通过以下两种方式解决:

  1. 使用CSS强制隐藏滚动条(兼容方案):
::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
  color: transparent;
}
  1. 使用原生配置(需重新编译): 在manifest.json中配置:
"app-plus": {
  "scrollIndicator": "none"
}
回到顶部