Skip to content

Commit

Permalink
fixes, ensure superview layoutSubviews is called.
Browse files Browse the repository at this point in the history
  • Loading branch information
George Harker committed Apr 3, 2015
1 parent d70c669 commit 448c2c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pagingscrollview/src/NIPagingScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ - (NSRange)rangeOfVisiblePages {
return NSMakeRange(0, 0);
}

NSInteger visibleRange = _pageInset == 0 ? 1 : 2;
NSInteger visibleRange = (_pageInset == 0) ? 1 : 2;
NSInteger currentVisiblePageIndex = [self currentVisiblePageIndex];

NSInteger firstVisiblePageIndex = NIBoundi(currentVisiblePageIndex - visibleRange, 0, self.numberOfPages - 1);
Expand Down Expand Up @@ -422,6 +422,7 @@ - (void)setFrame:(CGRect)frame {
}

- (void)layoutSubviews {
[super layoutSubviews];
_scrollView.contentSize = [self contentSizeForPagingScrollView];
[self layoutVisiblePages];
}
Expand Down

0 comments on commit 448c2c9

Please sign in to comment.