How to change the background color of the UIAlertController?

前端 未结 10 1457
耶瑟儿~
耶瑟儿~ 2020-11-30 03:49

Due to strange behavior of UIActionSheet in iOS 8, I have implemented UIAlertController with UIAction as buttons in it. I would like to change the entire background of the U

10条回答
  •  日久生厌
    2020-11-30 04:20

    maybe you like the use the blur effect in the dark mode. Here is a very easy way to get this:

    UIVisualEffectView.appearance(whenContainedInInstancesOf: [UIAlertController.classForCoder() as! UIAppearanceContainer.Type]).effect = UIBlurEffect(style: .dark)
    

提交回复
热议问题