Commit 8da49e4e authored by Carola Nitz's avatar Carola Nitz

PageStripViewController: adjust contentInset and scrollarea to not be covered and go edge to edge

parent 7dcb66aa
......@@ -76,11 +76,18 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollect
buttonBarView.leftAnchor.constraint(equalTo: view.leftAnchor),
buttonBarView.heightAnchor.constraint(equalToConstant: 35)
])
//make sure that top and bottom are not covered by tabbar and navigationbar
let bottomGuide: NSLayoutConstraint
if #available(iOS 11.0, *) {
bottomGuide = containerView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
} else {
bottomGuide = containerView.bottomAnchor.constraint(equalTo: bottomLayoutGuide.topAnchor)
}
NSLayoutConstraint.activate([
containerView.topAnchor.constraint(equalTo: buttonBarView.bottomAnchor),
containerView.rightAnchor.constraint(equalTo: view.rightAnchor),
containerView.leftAnchor.constraint(equalTo: view.leftAnchor),
containerView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
bottomGuide
]
)
......
......@@ -18,7 +18,7 @@ open class ButtonBarView: UICollectionView {
open var separatorView: UIView!
internal let selectedBarHeight: CGFloat = 4
internal let separatorHeight: CGFloat = 0.5
internal let separatorHeight: CGFloat = 1.5
var selectedIndex = 0
......
......@@ -59,6 +59,11 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
containerView.showsHorizontalScrollIndicator = false
containerView.isPagingEnabled = true
containerView.backgroundColor = PresentationTheme.current.colors.background
if #available(iOS 11.0, *) {
containerView.contentInsetAdjustmentBehavior = .never
} else {
automaticallyAdjustsScrollViewInsets = false
}
view.addSubview(containerView)
reloadViewControllers()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment