ios - XLPagerTabStrip 之间的空白

标签 ios iphone swift4 xlpagertabstrip

我正在尝试在我的应用程序中实现 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

最佳答案

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

关于ios - XLPagerTabStrip 之间的空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49023450/

相关文章:

ios - 在 objective-c 中更改应用程序扩展的屏幕旋转

ios - 为什么从库中获取照片时 imagePickerController 会崩溃,但从相机中获取照片却可以正常工作

iphone - 在没有导航菜单的情况下使用 ECSliding 切换 View

ios - Swift 将方法中的特定值作为参数传递

ios - 在其他装配中重复使用装配

ios - `phonegap run ios` -> `create: Command failed with exit code ENOENT`

ios - 如何根据下载的图像大小创建动态大小的行高?

swift - 我如何在 Swift 4 中测试具有关联值的枚举案例的等效性

iphone - 在类之间传递NSString

iphone - iOS "CABasicAnimation"动画完成后将组件带到原始位置