说明:本文档适用于小部件3.0。
可滚动视图区域
注意:使用 scroll-view 时如果Y轴滚动需要配合 my.setGestureMode( {"gestureMode": "inner"}) 一起使用,设置所有手势由小部件内部元素响应;
my.setGestureMode( {"gestureMode": "inner"}) 
   
| 属性 | 类型 | 描述 | 是否支持 | 将要支持 | 
| scroll-x | Boolean | 允许横向滚动。 默认值: false | / | 是 | 
| scroll-y | Boolean | 允许纵向滚动。 | / | 是 | 
| onScroll | EventHandle | 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth}。 | / | 是 | 
| upper-threshold | Number | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件。 | / | 否 | 
| lower-threshold | Number | 距底部/右边多远时(单位px),触发 scrolltolower 事件。 | / | 否 | 
| onScrollToUpper | EventHandle | 滚动到顶部/左边,会触发 scrolltoupper 事件。 | / | 否 | 
| onScrollToLower | EventHandle | 滚动到底部/右边,会触发 scrolltolower事件。 | / | 否 | 
| onTouchStart | EventHandle | 触摸动作开始。 | / | 否 | 
| onTouchEnd | EventHandle | 触摸动作结束。 | / | 否 | 
| onTouchMove | EventHandle | 触摸后移动。 | / | 否 | 
| onTouchCancel | EventHandle | 触摸动作被打断,如来电提醒、弹窗。 | / | 否 | 
| scroll-top | Number | 设置竖向滚动条位置。 | / | 否 | 
| scroll-left | Number | 设置横向滚动条位置。 | / | 否 | 
| scroll-into-view | String | 滚动到子元素,值应为某子元素的 id。当滚动到该元素时,元素顶部对齐滚动区域顶部。说明:scroll-into-view 的优先级高于 scroll-top。 | / | 否 | 
| scroll-with-animation | Boolean | 在设置滚动条位置时使用动画过渡。 | / | 否 | 
| scroll-animation-duration | Number | 当 scroll-with-animation设置为 true 时,可以设置 scroll-animation-duration 来控制动画的执行时间,单位 ms。 | / | 否 | 
| enable-back-to-top | Boolean | 当点击 iOS 顶部状态栏或者双击 Android 标题栏时,滚动条返回顶部,只支持竖向。 | / | 否 | 
| trap-scroll | Boolean | 纵向滚动时,当滚动到顶部或底部时,强制禁止触发页面滚动,仍然只触发 scroll-view 自身的滚动。 | / | 否 | 
| disable-lower-scroll | String | 发生滚动前,对滚动方向进行判断,当方向是顶部/左边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到顶部/左边,禁止滚动。 | / | 否 | 
| disable-upper-scroll | String | 发生滚动前,对滚动方向进行判断,当方向是底部/右边时,如果值为 always 将始终禁止滚动,如果值为 out-of-bounds 且当前已经滚动到底部/右边,禁止滚动。 | / | 否 |