gpt4 book ai didi

ios - 用户界面标签 : change a text color when click button

转载 作者:行者123 更新时间:2023-11-29 03:33:22 25 4
gpt4 key购买 nike

我是 iOS 编程的初学者。

因此,我想在用户单击按钮时更改文本颜色。

我的代码:

- (IBAction)buttonGetText:(id)sender {
self.textChange.textColor = "red";
}

但它不起作用。我需要做什么?谢谢大家。

最佳答案

这个:

self.textChange.textColor = "red"; 

没有意义,您需要使用UIColor

试试这个:

self.textChange.textColor = [UIColor redColor]; 

关于ios - 用户界面标签 : change a text color when click button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19497447/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com