uni-app 取消页面滚动条

¥20.00
最近在使用uni-app开发小程序和app的时候,页面过长时右侧总是会出现滚动条,请问如何才能不显示这个滚动条又不影响页面的正常上下滑动呢

最佳解决方案

app端

app-plus设置属性'scrollIndicator': 'none'

页面最外层用scroll-view组件包住,并在app.vue写css,如下

html

<template>
	<scroll-view scroll-y="true">
	    <view>页面内容</view>
	</scroll-view>
</template>

css

::-webkit-scrollbar {width: 0px; height: 0px;color: transparent;}

小程序

页面最外层用scroll-view组件包住,并在app.vue写css,如下

html

<template>
	<scroll-view scroll-y="true">
	    <view>页面内容</view>
	</scroll-view>
</template>

css

::-webkit-scrollbar {width: 0px; height: 0px;color: transparent;}


上右下左 T0 被采纳率100%
2020-11-20 10:24
打赏 1 3
页面统计
3908 访问
1 帮助
0.00 打赏

hierror 2019 © hierror.com 京ICP备13026190号-1

通知消息
  • 暂无任何消息