如何设置类型为“复选框”的NSButton标题的颜色? fontsize接受来自fontpicker的输入,但是,coloer没有。
答案 0 :(得分:6)
试试这个 -
NSMutableAttributedString *attributedButtonTitle = [[NSMutableAttributedString alloc] initWithString:@"Put the title of your choice"];
[attributedButtonTitle addAttribute:NSForegroundColorAttributeName value:[NSColor blueColor] range:NSMakeRange(0,[@"Put the title of your choice" length] )];
[buttonWithTypeCheckBox setAttributedTitle:attributedButtonTitle];
希望这会有所帮助:)