【发布时间】:2019-05-15 04:30:26
【问题描述】:
我想在应用程序中使用外观设置我的 AlertController 的外观。 它适用于背景和按钮,但无论我尝试什么,标题和消息的标签总是保持黑色。
这是我正在做的事情:
UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .orange
UIVisualEffectView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).effect = UIBlurEffect(style: .dark)
UILabel.appearance(whenContainedInInstancesOf: [UIAlertController.self]).textColor = .white
这是我得到的结果:
任何想法,我如何设置标题和消息的颜色,或者为什么在这种情况下更改 UILabel 的外观不起作用?
【问题讨论】:
标签: ios uialertcontroller uiappearance