简体   繁体   中英

iOS - UIButton turns grey on showing action sheet and then blue on dismissing the action sheet

I got a green button on the screen.

But on showing the action sheet , green button turns grey.

And when the action sheet is dismissed the button turns blue .

Code to show action sheet:

    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)

Question Why the button is changing its background color ? It's changing from original green color to grey color and then blur color .

That is the default behaviour.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM