Skip to content

Commit

Permalink
Refs robotmedia#1 fixed
Browse files Browse the repository at this point in the history
Bug fix of the issue with index change on rotation.
  • Loading branch information
Yulia Myhailova committed Jun 5, 2014
1 parent c25d913 commit 896a5c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RMGallery/RMGalleryView.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ -(void)scrollViewWillEndDragging:(UIScrollView*)scrollView withVelocity:(CGPoint

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (!self.scrollEnabled) {
return;
}
const NSUInteger index = [_imageFlowLayout indexForOffset:scrollView.contentOffset];
if (index != _galleryIndex)
{
Expand Down
11 changes: 11 additions & 0 deletions RMGallery/RMGalleryViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ - (void)viewWillAppear:(BOOL)animated
}
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
duration:(NSTimeInterval)duration
{
_galleryView.scrollEnabled = NO;
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromOrientation
{
_galleryView.scrollEnabled = YES;
}

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
Expand Down

0 comments on commit 896a5c2

Please sign in to comment.