diff --git a/Sources/TabPageOption.swift b/Sources/TabPageOption.swift index 61663d2..a821420 100644 --- a/Sources/TabPageOption.swift +++ b/Sources/TabPageOption.swift @@ -23,10 +23,11 @@ public struct TabPageOption { public var pageBackgoundColor: UIColor = UIColor.white public var isTranslucent: Bool = true public var hidesTabBarOnSwipe: Bool = false - - internal var tabBarAlpha: CGFloat { - return isTranslucent ? 0.95 : 1.0 - } + public var coverNavBar: Bool = false + public var tabBarAlpha: CGFloat = 0.95 +// public var tabBarAlpha: CGFloat { +// return isTranslucent ? 0.95 : 1.0 +// } internal var tabBackgroundImage: UIImage { return convertImage() } diff --git a/Sources/TabPageViewController.swift b/Sources/TabPageViewController.swift index 8d7ca25..f5b4ec3 100644 --- a/Sources/TabPageViewController.swift +++ b/Sources/TabPageViewController.swift @@ -25,9 +25,8 @@ open class TabPageViewController: UIPageViewController { } fileprivate var beforeIndex: Int = 0 fileprivate var tabItemsCount = 0 - fileprivate var defaultContentOffsetX: CGFloat { - return self.view.bounds.width - } + fileprivate var defaultContentOffsetX: CGFloat = UIScreen.main.bounds.width + fileprivate var shouldScrollCurrentBar: Bool = true lazy fileprivate var tabView: TabView = self.configuredTabView() fileprivate var statusView: UIView? @@ -44,7 +43,7 @@ open class TabPageViewController: UIPageViewController { setupPageViewController() setupScrollView() - updateNavigationBar() + if option.coverNavBar { updateNavigationBar() } } override open func viewWillAppear(_ animated: Bool) { @@ -62,7 +61,7 @@ open class TabPageViewController: UIPageViewController { override open func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - updateNavigationBar() + if option.coverNavBar { updateNavigationBar() } tabView.layouted = true } @@ -72,6 +71,11 @@ open class TabPageViewController: UIPageViewController { navigationController?.navigationBar.shadowImage = nil navigationController?.navigationBar.setBackgroundImage(nil, for: .default) } + + + public func refreshTabs() { + tabView = configuredTabView() + } }