Add began and ended event to CCScrollview#1978
Add began and ended event to CCScrollview#1978jareguo merged 4 commits intococos:masterfrom feijing566:master
Conversation
| /** | ||
| * !#en Query whether the user is currently dragging the ScrollView to scroll it | ||
| * !#zh 用户是否在拖拽当前滚动视图 | ||
| * @method getContentPosition |
|
其他的我没啥问题了,你们在看看 @jare @pandamicro |
| 'bounce-right' : EventType.BOUNCE_RIGHT, | ||
| 'bounce-top' : EventType.BOUNCE_TOP, | ||
| 'scroll-ended' : EventType.AUTOSCROLL_ENDED, | ||
| 'auto-scroll-ended' : EventType.AUTOSCROLL_ENDED, |
There was a problem hiding this comment.
除非用户用的是字符串 ‘scroll-ended’
There was a problem hiding this comment.
用户不会用到的,因为事件传递出来的是EventType.AUTOSCROLL_ENDED,是数字
| 'scroll-ended-with-threshold' : EventType.AUTOSCROLL_ENDED_WITH_THRESHOLD | ||
| 'scroll-ended-with-threshold' : EventType.AUTOSCROLL_ENDED_WITH_THRESHOLD, | ||
| 'scroll-began': EventType.SCROLLING_BEGAN, | ||
| 'scroll-ended': EventType.SCROLLING_ENDED |
There was a problem hiding this comment.
请把新增的事件补充到 event 注释区域中,在这个文件的最下面,你搜索 @event touch-up 就能看到
| * !#zh 滚动视图滚动结束的时候发出的事件 | ||
| * @property {Number} SCROLLING_ENDED | ||
| */ | ||
| SCROLLING_ENDED: 13 |
There was a problem hiding this comment.
请问什么时候需要区分 AUTOSCROLL_ENDED 和 SCROLLING_ENDED?
There was a problem hiding this comment.
在没有触发惯性滚动的时候 就需要用SCROLLING_ENDED来通知滚动结束
There was a problem hiding this comment.
滚动有2种结束方式,1种是立即结束1种就是需要惯性滚动一段距离后结束,这里的2个事件就是用来对应这2种操作
There was a problem hiding this comment.
那把这两个事件合并为一个 SCROLL_ENDED 就行了吧?
There was a problem hiding this comment.
这个就要看具体需求了。毕竟这里是2种状态,分成2个事件也是有他的价值的
There was a problem hiding this comment.
好像不对啊,判断是否要继续加载,应该是监听 scrolling 事件吧?因为只要有在滚动,不论是用户手指在拖拽还是自动滚动,都需要继续加载内容。
There was a problem hiding this comment.
就先合并这两个事件吧,统一叫 SCROLL_ENDED 就好,之后要是有遇到合理的需求再拆分。事件名称保持不变,还是叫做 scroll-ended,只不过之前是自动滚动停止时才触发,现在是不自动滚动的话,手动停止滚动也触发。
There was a problem hiding this comment.
这样会带来一个问题就是跟jsb的表现不一致,需要同步修改jsb的代码
|
已合并,感谢帮忙! |
sync from cocos2d/cocos2d-x#18054
@cocos-creator/engine-admins