如何设置类型为"复选框"的NSButton标题的颜色?fontsize接受来自fontpicker的输入,但是,coloer不接受.
试试这个-
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];
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助 :)
| 归档时间: |
|
| 查看次数: |
1013 次 |
| 最近记录: |