Skip to content
Browse files

Fix a bug that would cause the current page index to unexpectedly cha…

…nge during device rotation
  • Loading branch information...
1 parent 7747308 commit 7d26d58c6cfd5f6208fc0dde0d0cf5f85a39a15d @dorshorst dorshorst committed Sep 20, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 SYPaginator/SYPaginatorView.m
View
5 SYPaginator/SYPaginatorView.m
@@ -127,6 +127,11 @@ - (void)layoutSubviews {
UIView *view = [_pages objectForKey:key];
view.frame = [self frameForPageAtIndex:key.integerValue];
}
+
+ // Since the location of the current page will likely change during an orientation change (and since this is called
+ // within the animation block during said change) setting the page index will assure all the necessary offsets
+ // are calculated and assigned for the new view bounds
+ [self setCurrentPageIndex:self.currentPageIndex];
}

0 comments on commit 7d26d58

Please sign in to comment.
Something went wrong with that request. Please try again.