From ecc129c3230c1ed58a5c05451114711d33fbfc52 Mon Sep 17 00:00:00 2001 From: Alexsandersky Date: Wed, 9 Mar 2016 17:54:13 +0400 Subject: [PATCH] resize current image after rotation device --- SKPhotoBrowser/SKPhotoBrowser.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/SKPhotoBrowser/SKPhotoBrowser.swift b/SKPhotoBrowser/SKPhotoBrowser.swift index 71ff72e..21d68e2 100644 --- a/SKPhotoBrowser/SKPhotoBrowser.swift +++ b/SKPhotoBrowser/SKPhotoBrowser.swift @@ -276,10 +276,22 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate { pagingScrollView.frame = frameForPagingScrollView() pagingScrollView.contentSize = contentSizeForPagingScrollView() + + if visiblePages.count > 0 { + for page in visiblePages { + page.frame = frameForPageAtIndex(currentPageIndex) + page.setMaxMinZoomScalesForCurrentBounds() + if page.captionView != nil { + page.captionView.frame = frameForCaptionView(page.captionView, index: currentPageIndex) + } + } + } + pagingScrollView.contentOffset = contentOffsetForPageAtIndex(currentPageIndex) toolBar.frame = frameForToolbarAtOrientation() - + // where did start + didStartViewingPageAtIndex(currentPageIndex) isPerformingLayout = false }