0

我正在尝试在我的应用程序中实现 XLPagerTabStrip。一切都很好,因为我按照官方教程将我的 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
    }
}

我的应用程序的图像

4

1 回答 1

1

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

于 2018-02-28T17:21:35.960 回答