Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift tvOS UISegmentedControl与外观设置不匹配_Swift_Uisegmentedcontrol_Tvos - Fatal编程技术网

Swift tvOS UISegmentedControl与外观设置不匹配

Swift tvOS UISegmentedControl与外观设置不匹配,swift,uisegmentedcontrol,tvos,Swift,Uisegmentedcontrol,Tvos,在我的tvOS应用程序中,我有一个UISegmentedControl,当切换所选片段或离开UISegmented control的焦点时,会出现奇怪的动画,字体和颜色外观与我配置的任何外观设置都不匹配。请参阅所附的.mov。 对此有什么建议吗 屏幕截图: if let font = UIFont(name: "Marker Felt", size: 18.0) ?? UIFont(name: "HelveticaNeue-Bold", size: 18.0), let

在我的tvOS应用程序中,我有一个UISegmentedControl,当切换所选片段或离开UISegmented control的焦点时,会出现奇怪的动画,字体和颜色外观与我配置的任何外观设置都不匹配。请参阅所附的.mov。 对此有什么建议吗

屏幕截图:

    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)
    }