How to change UIAlertController button text colour in iOS9?

后端 未结 14 1373
隐瞒了意图╮
隐瞒了意图╮ 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:52

    I've run into something similar in the past and the issue seems to stem from the fact that the alert controller's view isn't ready to accept tintColor changes before it's presented. Alternatively, try setting the tint color AFTER you present your alert controller:

    [self presentViewController:strongController animated:YES completion:nil];
    strongController.view.tintColor = [UIColor black];
    

提交回复
热议问题