如何更改UIAlertView文本颜色? [英] How to change UIAlertView text color?

查看:62
本文介绍了如何更改UIAlertView文本颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在使用 http://kwigbo.com/post/318396305/iphone-sdk-custom-uialertview-background-color 用于我的自定义UIAlertView.一切工作正常,但我试图更改标题和消息文本的颜色,我想更改按钮的颜色.有什么办法吗?我尝试使用:

I'm currently using http://kwigbo.com/post/318396305/iphone-sdk-custom-uialertview-background-color for my custom UIAlertView. Everything is working fine but I'm trying to change the title and message text colors and I would like to change the button color. Is there any way to do this? I've tried using:

UILabel *theTitle = [AlertView valueForKey:@"_titleLabel"];
    [theTitle setTextColor:[UIColor redColor]];

但是我无法使它正常工作.任何帮助,将不胜感激.谢谢.

but I can't get it to work. Any help would be appreciated. Thanks.

推荐答案

检查setTextColor是否被描述.

Check to see if setTextColor is depricated.

我以为是

theTitle.text.color = [UIColor redColor];

或者您可以使用

[theTitle.text setColor:[UIColor redColor]];

不确定第二个例子,第一个例子可以解决问题.

Not totally sure on the second one, the first example should do the trick though.

这篇关于如何更改UIAlertView文本颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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