gpt4 book ai didi

ios - XLPagerTabStrip - 选定的选项卡选择不起作用

转载 作者:行者123 更新时间:2023-11-29 11:51:32 25 4
gpt4 key购买 nike

XLPagerTabStrip 库中的选定选项卡指示器不适用于 Swift 3 和 XCode 8

我正在为 Tab Strip 使用以下自定义

    super.viewDidLoad()

buttonBarView.selectedBar.backgroundColor = UIColor(red: 240.0/255.0, green: 89.0/255.0, blue: 43.0/255.0, alpha: 1.0)
buttonBarView.backgroundColor = UIColor.clear

settings.style.selectedBarHeight = 3.0
settings.style.selectedBarBackgroundColor = UIColor(red: 240.0/255.0, green: 89.0/255.0, blue: 43.0/255.0, alpha: 1.0)

settings.style.buttonBarHeight = 45.0
settings.style.buttonBarMinimumLineSpacing = 0.0
settings.style.buttonBarLeftContentInset = 0.0
settings.style.buttonBarRightContentInset = 0.0
settings.style.buttonBarItemFont = UIFont(name: "Avenir-Book", size: 12.0)!
settings.style.buttonBarItemBackgroundColor = UIColor.clear
settings.style.buttonBarItemLeftRightMargin = 0.0
settings.style.buttonBarItemTitleColor = UIColor.black

最佳答案

这是上述问题的解决方案

    class ViewController: ButtonBarPagerTabStripViewController {

override func viewDidAppear(_ animated: Bool) {
let selectedBarHeight: CGFloat = 2

buttonBarView.selectedBar.frame.origin.y = buttonBarView.frame.size.height - selectedBarHeight
buttonBarView.selectedBar.frame.size.height = selectedBarHeight

}


override func viewDidLoad() {
settings.style.selectedBarBackgroundColor = .green

super.viewDidLoad()
}
}

关于ios - XLPagerTabStrip - 选定的选项卡选择不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40925207/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com