2023-08-04 uniapp之scroll-view无法横向滚动
解决方案:
给scroll-view设置样式
white-space: nowrap
然后scroll-view里面的子项要设置样式为
display: inline-block;
接着scroll-view的属性scroll-x要设置为true
scroll-x="true"
如果这都不出现滚动,那么原因可能有二:
1.scroll-view的宽度大于或等于父级的宽度,解决方案为:手动设置scroll-view的宽度,直至能滑动为止,比如:
width: 92vw
2.浏览器兼容性问题,可尝试先给scroll-view设置样式:
overflow-x: scroll;
overflow: auto;