我正在尝试设计一个XLPagerTabStrip控件,其中整体主题随着选项卡的变化而变化。
以下是选项卡更改时调用的内容
changeCurrentIndexProgressive = { [weak self] (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in
guard changeCurrentIndex == true else { return }
oldCell?.label.textColor = .black
newCell?.label.textColor = UIColor.red
//Change the navigation bar's color
self?.navigationController?.navigationBar.barTintColor = UIColor.red
//Attempting to change the selected bar color
self?.settings.style.selectedBarBackgroundColor = UIColor.green
}
更改导航控制器颜色有效,但我无法从此处更改所选栏(或设置对象下的任何内容)?
加载视图后是否可以更改设置?