iOS - UIButton在显示操作表时变为灰色,然后在取消操作表时变为蓝色

时间:2017-02-20 08:10:48

标签: ios swift uibutton

我屏幕上有一个绿色按钮。

但是在显示操作表时,绿色按钮变为灰色。

当操作表被取消时,按钮变为蓝色。

显示操作表的代码:

    let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)

    let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: {
        (alert: UIAlertAction!) -> Void in
        //println("Cancelled")
    })


    self.present(optionMenu, animated: true, completion: nil)

问题 为什么按钮会改变其背景颜色? 它从原始绿色变为灰色,然后模糊颜色。

0 个答案:

没有答案