在我的tvOS应用程序中,我有一个UISegmentedControl,当切换选定的段或从UISegmented控件离开焦点时,有一个奇怪的动画,字体和颜色外观与我配置的任何外观设置都不匹配。见附件.mov。 有关纠正此事的任何建议吗?
截屏: https://www.dropbox.com/s/70kiobvagrri23n/UISegmentedControl.mov?dl=0
if let font = UIFont(name: "Marker Felt", size: 18.0) ?? UIFont(name: "HelveticaNeue-Bold", size: 18.0),
let select = leaderboardSelect {
let attrsNormal: [AnyHashable: Any] = [NSFontAttributeName: font, NSForegroundColorAttributeName: UIColor.yellow]
select.setTitleTextAttributes(attrsNormal, for: .normal)
select.setTitleTextAttributes(attrsNormal, for: .highlighted)
select.setTitleTextAttributes(attrsNormal, for: .disabled)
select.setTitleTextAttributes(attrsNormal, for: .selected)
select.setTitleTextAttributes(attrsNormal, for: .application)
select.setTitleTextAttributes(attrsNormal, for: .reserved)
let attrSelected: [AnyHashable: Any] = [NSFontAttributeName: font, NSForegroundColorAttributeName: UIColor.orange]
select.setTitleTextAttributes(attrSelected, for: .focused)
}