小程序组件 scroll-view 中分别有上下竖向滑动和左右横向滑动之分,在这次项目中刚好需要用到横向滑动,但在测试过程中发现横向滑动没有了效果(静止在那里没移动过),经调试发现:

  1.scroll-view 中的需要滑动的元素不可以用 float 浮动;

  2.scroll-view 中的包裹需要滑动的元素的大盒子用 display:flex; 是没有作用的;

  3.scroll-view 中的需要滑动的元素要用 dislay:inline-block; 进行元素的横向编排;

  4.包裹 scroll-view 的大盒子有明确的宽和加上样式-->  overflow:hidden;white-space:nowrap;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-02-14
  • 2021-04-10
  • 2022-12-23
  • 2022-01-21
  • 2021-12-23
猜你喜欢
  • 2021-09-17
  • 2022-02-12
  • 2021-11-23
  • 2022-02-21
  • 2021-12-02
  • 2021-05-10
相关资源
相似解决方案