I'm wondering if it's possible to customize in app alerts with the UIAlertController. I haven't seen anything that explicitly says that you can. Does anyone know of a way I can add a custom appearance, particularly with fonts on these alerts?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can do it with appearanceWhenContainedIn. To set up background color, here's an example:
[[UIView appearanceWhenContainedIn:UIAlertController.class, nil] setBackgroundColor:[UIColor yellowColor]];
Or tint color:
[[UIView appearanceWhenContainedIn:UIAlertController.class, nil] setTintColor:[UIColor whiteColor]];