当前位置: 首页 > 编程笔记 >

iOS 设置标题颜色

南门刚捷
2023-03-14
本文向大家介绍iOS 设置标题颜色,包括了iOS 设置标题颜色的使用技巧和注意事项,需要的朋友参考一下

示例

//Swift
button.setTitleColor(color, forControlState: controlState)

//Objective-C
[button setTitleColor:(nullable UIColor *) forState:(UIControlState)];

将标题颜色设置为蓝色

//Swift
button.setTitleColor(.blue, for: .normal)

//Objective-C
[button setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]
           

 类似资料: