Skip to content

Commit

Permalink
fix: handle transparent navigation bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasan Can Aslan committed Jan 2, 2023
1 parent dcd7d12 commit b63bab6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/ImageViewer_swift/ImageCarouselViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public class ImageCarouselViewController: UIPageViewController, ImageViewerTrans
navItem.leftBarButtonItem?.tintColor = theme.tintColor
navBar.alpha = 0.0
navBar.items = [navItem]
navBar.delegate = self
navBar.insert(to: view)
}

Expand Down Expand Up @@ -264,3 +265,9 @@ extension ImageCarouselViewController: UIPageViewControllerDataSource {
imageLoader: vc.imageLoader)
}
}

extension ImageCarouselViewController: UINavigationBarDelegate {
public func position(for bar: UIBarPositioning) -> UIBarPosition {
return UIBarPosition.topAttached
}
}

0 comments on commit b63bab6

Please sign in to comment.