支持最后一个跳转到初始位置时,带有动画效果#310
Open
ZZZZou wants to merge 2 commits intogsdios:masterfrom
Open
Conversation
added 2 commits
May 3, 2017 14:10
Owner
|
这个是不是会明显看到滚动经过了很多张图片? |
Author
|
不会啊,从效果上看,是看不出差别出来的,在跳回初始位置时,调用的是- (void)scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated这个方法,因为把animated置为NO,所以不会有那种滚动经过很多张图片的效果 |
Author
|
因为您现阶段的项目中,在最后一个跳转到初始化位置时,是没有动画效果的。而且如果反方向滚动(跟自动滚动方向相反),到了第一个这里,就不能继续滚动了。当然这个问题是极端情况,一般也不会遇到。 |
Owner
|
你是实现了在滑动到临界位置时再瞬间跳回中间位置的功能模拟无限循环吗?我随后测试下,没有问题的话就merge下,感谢关注与支持! |
|
请问作者,手动滑动到最后一张图片,是在调用了什么方法,回到第一张图片的。如果是scrollToItemAtIndexPath:,这个方法只在自动轮播的scrollToIndex 方法里面调用还有 layoutSubview 有调用啊?我看了半天没怎么明白,望指点一二。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在scrollViewDidEndScrollingAnimation这个代理方法里面,增加了一个判断,使得最后一个或第一个跳转到初始位置(也就是collection的中间位置)时,带有跟其他轮播一样的动画效果