Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HYBLoopScrollView/HYBLoopScrollView/HYBLoopScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ - (void)setTimeInterval:(NSTimeInterval)timeInterval {

- (void)autoScroll {
NSInteger curIndex = (self.collectionView.contentOffset.x + self.layout.itemSize.width * 0.5) / self.layout.itemSize.width;
if(curIndex < 0)//当轮播控件被添加到一个还未显示的界面上时self.layout.itemSize.width为0会导致异常
return;
NSInteger toIndex = curIndex + 1;

NSIndexPath *indexPath = nil;
Expand Down