是否可以在iOS8的新XCode中自定义UIAlertController的字体和外观? [英] Is it possible to customize the font and appearance of a UIAlertController in the new XCode w/ iOS8?

查看:126
本文介绍了是否可以在iOS8的新XCode中自定义UIAlertController的字体和外观?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用UIAlertController自定义应用提醒。我没有看到任何明确表示你能做到的事情。有没有人知道我可以添加自定义外观的方式,特别是这些警报上的字体?

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?

推荐答案

你可以用appearanceWhenContainedIn。要设置背景颜色,这里有一个例子:

You can do it with appearanceWhenContainedIn. To set up background color, here's an example:

[[UIView appearanceWhenContainedIn:UIAlertController.class, nil] setBackgroundColor:[UIColor yellowColor]];

或淡色:

[[UIView appearanceWhenContainedIn:UIAlertController.class, nil] setTintColor:[UIColor whiteColor]];

这篇关于是否可以在iOS8的新XCode中自定义UIAlertController的字体和外观?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆