iOS 10,UIToolbar背景颜色不会改变

我有一个应用程序,自iOS 8以来一直存在.它的工作方式是你有一个UITableView并点击单元格来产生一个分数,取决于底部的UI工具栏使用此方法改变颜色的分数:
func updateToolbarAndLabel(score: Int) {

    if(score <= -1) {
        self.toolbar.backgroundColor = UIColor.greenColor()
    } else if(score <= 0) {
        self.toolbar.backgroundColor = .None
    } else if(score <= 9) {
        self.toolbar.backgroundColor = UIColor.greenColor()
    } else if(score <= 29) {
       self.toolbar.backgroundColor = UIColor.yellowColor()
    } else if(score >= 30) {
        self.toolbar.backgroundColor = UIColor.redColor()
    }
    if (score <= 0) {
        self.scoreshow.text = "0"
    } else {
        self.scoreshow.text = (score as NSNumber).stringValue }
}

然后每当用这个点击表格视图时调用它:

func tableView(tableView:UITableView,didSelectRowAtIndexPath indexPath:NSIndexPath)
{

事情是,它自从我构建应用程序以来一直有效,但在iOS 10上,它没有.简单地把颜色改变了……

任何帮助,将不胜感激

解决方法

我能够解决它,它改为:BarTintColor,发现它自己在苹果文档中找不到任何提及它的东西

像这样使用它:self.toolbar.barTintColor

编辑:现在有一些人在GM发布文档中提到它,请参阅下面的回答

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...