adding `buttonBarMinimumInteritemSpacing`
This commit is contained in:
parent
6340728fa9
commit
2f2a4fc4de
|
|
@ -79,7 +79,7 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType : UICollec
|
|||
buttonBarView.scrollsToTop = false
|
||||
let flowLayout = buttonBarView.collectionViewLayout as! UICollectionViewFlowLayout
|
||||
flowLayout.scrollDirection = .horizontal
|
||||
flowLayout.minimumInteritemSpacing = settings.style.buttonBarMinimumLineSpacing ?? flowLayout.minimumLineSpacing
|
||||
flowLayout.minimumInteritemSpacing = settings.style.buttonBarMinimumInteritemSpacing ?? flowLayout.minimumInteritemSpacing
|
||||
flowLayout.minimumLineSpacing = settings.style.buttonBarMinimumLineSpacing ?? flowLayout.minimumLineSpacing
|
||||
let sectionInset = flowLayout.sectionInset
|
||||
flowLayout.sectionInset = UIEdgeInsetsMake(sectionInset.top, settings.style.buttonBarLeftContentInset ?? sectionInset.left, sectionInset.bottom, settings.style.buttonBarRightContentInset ?? sectionInset.right)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ public struct ButtonBarPagerTabStripSettings {
|
|||
|
||||
public struct Style {
|
||||
public var buttonBarBackgroundColor: UIColor?
|
||||
public var buttonBarMinimumInteritemSpacing: CGFloat?
|
||||
public var buttonBarMinimumLineSpacing: CGFloat?
|
||||
public var buttonBarLeftContentInset: CGFloat?
|
||||
public var buttonBarRightContentInset: CGFloat?
|
||||
|
|
@ -137,7 +138,7 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa
|
|||
buttonBarView.scrollsToTop = false
|
||||
let flowLayout = buttonBarView.collectionViewLayout as! UICollectionViewFlowLayout
|
||||
flowLayout.scrollDirection = .horizontal
|
||||
flowLayout.minimumInteritemSpacing = 0
|
||||
flowLayout.minimumInteritemSpacing = settings.style.buttonBarMinimumInteritemSpacing ?? flowLayout.minimumInteritemSpacing
|
||||
flowLayout.minimumLineSpacing = settings.style.buttonBarMinimumLineSpacing ?? flowLayout.minimumLineSpacing
|
||||
let sectionInset = flowLayout.sectionInset
|
||||
flowLayout.sectionInset = UIEdgeInsetsMake(sectionInset.top, settings.style.buttonBarLeftContentInset ?? sectionInset.left, sectionInset.bottom, settings.style.buttonBarRightContentInset ?? sectionInset.right)
|
||||
|
|
|
|||
Loading…
Reference in New Issue