我正在为 UIButton
headingButton.titleLabel.textColor = [UIColor colorWithRed:36/255.0
green:71/255.0
blue:113/255.0
alpha:1.0];
它不会改变我在另一个工作代码中使用的相同代码的颜色。
最佳答案
使用
Objective-C
[headingButton setTitleColor:[UIColor colorWithRed:36/255.0 green:71/255.0 blue:113/255.0 alpha:1.0] forState:UIControlStateNormal];
swift
headingButton.setTitleColor(.black, for: .normal)
https://stackoverflow.com/questions/6703699/
相关文章:
ios - 何时使用 dequeueReusableCellWithIdentifier 与 deq
ios - Xcode 调试器不打印对象并显示 nil,当它们不是时
ios - 更改 UIImageView 的图像时淡入淡出/溶解
objective-c - cocoa objective-c类中变量前面的下划线如何工作?
ios - 错误 : _handleNonLaunchSpecificActions in iOS9
ios - 如何在 UITableViewCell 之间添加间距