【问题标题】:Button of UIAlertController changes its color on click. How to solve? - SwiftUIAlertController 的按钮在单击时会更改其颜色。怎么解决? - 斯威夫特
【发布时间】:2015-10-15 15:10:02
【问题描述】:

我有一个带有tintColor 橙色的 UIAlertController,但每次我单击按钮时,它的颜色都会变为蓝色(我猜是本机颜色)。如何解决?

let orange: UIColor = UIColor(red: 232.0/255, green: 121.0/255, blue: 23.0/255, alpha: 1.0)

let alert = UIAlertController(title: "Welcome!", message: "", preferredStyle: UIAlertControllerStyle.Alert)
        alert.view.tintColor = orange
        alert.addAction(UIAlertAction(title: "Done", style: UIAlertActionStyle.Default, handler: nil))
        self.presentViewController(alert, animated: true, completion: nil)

【问题讨论】:

    标签: ios swift uialertcontroller


    【解决方案1】:

    这是iOS 9.0中的Bug,见apple Community bug reports,可能是固定在iOS 9.1

    更多参考请看link

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-12
      • 2016-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-01
      • 1970-01-01
      相关资源
      最近更新 更多