Is it possible to customize the font and appearance of a UIAlertController in the new XCode w/ iOS8?

一曲冷凌霜 提交于 2019-12-19 04:47:17

问题


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]];


来源:https://stackoverflow.com/questions/26357066/is-it-possible-to-customize-the-font-and-appearance-of-a-uialertcontroller-in-th

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!