Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Sources/TabPageOption.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
14 changes: 9 additions & 5 deletions Sources/TabPageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -44,7 +43,7 @@ open class TabPageViewController: UIPageViewController {

setupPageViewController()
setupScrollView()
updateNavigationBar()
if option.coverNavBar { updateNavigationBar() }
}

override open func viewWillAppear(_ animated: Bool) {
Expand All @@ -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
}

Expand All @@ -72,6 +71,11 @@ open class TabPageViewController: UIPageViewController {
navigationController?.navigationBar.shadowImage = nil
navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
}


public func refreshTabs() {
tabView = configuredTabView()
}
}


Expand Down