How to change UIAlertController button text colour in iOS9?

后端 未结 14 1351
隐瞒了意图╮
隐瞒了意图╮ 2020-12-15 16:16

The question is similar to iOS 8 UIActivityViewController and UIAlertController button text color uses window's tintColor but in iOS 9.

I have a UIAlertControlle

14条回答
  •  攒了一身酷
    2020-12-15 16:45

    In Swift 3.x:

    I found the following to work effectively. I call this at app launch .

    UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = UIColor.black
    

    So this would change the tint color of all UIAlertViewController button labels in your app globally. The only button label color it doesn't change are those which have a UIAlertActionStyle of destructive.

提交回复
热议问题