XLPagerTabStrip之间的空白

问题描述 投票:0回答:1

我正在尝试在我的应用程序中实现XLPagerTabStrip。一切都很好,因为我已经跟随官方Tutorial我已将我的collectionView的颜色更改为红色。当应用程序在模拟器中运行时,我看到有一个像图像一样的空白区域

我想知道如何删除该空白区域?因为它应该全红,我怎么能改变黑线的颜色?

这是我的代码:

override func viewDidLoad() {
    super.viewDidLoad()
    settings.style.buttonBarBackgroundColor = .red
    settings.style.buttonBarItemBackgroundColor = .red
    settings.style.selectedBarBackgroundColor = purpleInspireColor
    settings.style.buttonBarItemFont = UIFont.systemFont(ofSize: 12, weight: UIFont.Weight.regular)
    settings.style.selectedBarHeight = 0.5
    settings.style.buttonBarMinimumLineSpacing = 0
    settings.style.buttonBarItemTitleColor = .white
    settings.style.buttonBarItemsShouldFillAvailiableWidth = true
    settings.style.buttonBarLeftContentInset = 0
    settings.style.buttonBarRightContentInset = 0
    changeCurrentIndexProgressive = { [weak self] (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
        guard changeCurrentIndex == true else { return }
        oldCell?.label.textColor = .white
        newCell?.label.textColor = self?.purpleInspireColor
    }
}

image of my app

ios iphone swift4 xlpagertabstrip
1个回答
1
投票

我解决了我的问题,我忘了这行super.viewDidLoad()应该是viewDidload方法的最后一行

© www.soinside.com 2019 - 2024. All rights reserved.