SegmentControlの色合いを変更しようとすると、ナビゲーションバーのbarTintColorが変更されます。セグメントカラーのtintColorを設定しているときに、ナビゲーションを停止する方法barTintColorが変更されますか?
これを停止する方法を教えてください。
ためのコードであり、これはviewDidLoad
のこの内部試しセグメント制御
internal func wireUpUI() {
self.selectedSegmentIndex = 0
//DispatchQueue.main.async {
self.tintColor = Color.white
let segAttributesNormal: NSDictionary = [
NSForegroundColorAttributeName: Color.white,
NSFontAttributeName: UIFont(name: set(), size: fontSize(.medium))!
]
let segAttributesSelected: NSDictionary = [
NSForegroundColorAttributeName: Color.theme,
NSFontAttributeName: UIFont(name: set(), size: fontSize(.medium))!
]
self.setTitleTextAttributes(segAttributesNormal as? [AnyHashable : Any], for: UIControlState.normal)
self.setTitleTextAttributes(segAttributesSelected as? [AnyHashable : Any], for: UIControlState.selected)
// }
// Now bind the data
bindData(any: [])
}
スクリーンショットやコードの一部を追加できますか? –
segmentControlの目的のviewControllerを選択します。 viewDidLoad内にsegmentControlを作成します。あなたのsegmentControlのtintColorを設定します。そしてそれはそれです – Mannopson
私は同じことをしています –