some fix
This commit is contained in:
parent
66125de128
commit
7f2db66cdc
|
|
@ -276,13 +276,22 @@ public class SKPhotoBrowser: UIViewController, UIScrollViewDelegate {
|
|||
|
||||
pagingScrollView.frame = frameForPagingScrollView()
|
||||
pagingScrollView.contentSize = contentSizeForPagingScrollView()
|
||||
|
||||
//If we open the SKPhotoBrowser from CollectionView not the first image, we have one element in visiblepages and we should to take 0 element from visibleindex but that we should to use frame we should use currentPageIndex for frame's functions.
|
||||
if visiblePages.count > 0 {
|
||||
let page = visiblePages[currentPageIndex]
|
||||
page.frame = frameForPageAtIndex(currentPageIndex)
|
||||
page.setMaxMinZoomScalesForCurrentBounds()
|
||||
if page.captionView != nil {
|
||||
page.captionView.frame = frameForCaptionView(page.captionView, index: currentPageIndex)
|
||||
if visiblePages.count == 1 {
|
||||
let page = visiblePages[0]
|
||||
page.frame = frameForPageAtIndex(currentPageIndex)
|
||||
page.setMaxMinZoomScalesForCurrentBounds()
|
||||
if page.captionView != nil {
|
||||
page.captionView.frame = frameForCaptionView(page.captionView, index: currentPageIndex)
|
||||
}
|
||||
} else {
|
||||
let page = visiblePages[currentPageIndex]
|
||||
page.frame = frameForPageAtIndex(currentPageIndex)
|
||||
page.setMaxMinZoomScalesForCurrentBounds()
|
||||
if page.captionView != nil {
|
||||
page.captionView.frame = frameForCaptionView(page.captionView, index: currentPageIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue