how to Customise the NSSegmentedControl font and background color

1.9k Views Asked by At

I want to customise the background colour and text color for NSSegmentedControl. There is option to do this for IOS but not found anything for OSX.

2

There are 2 best solutions below

2
Hussain Shabbir On

Basically in your XIB inside attribute inspector of segmented control inside tint propery you can set the color or else samething you can achieve programatically as well.

4
northernman On

You can set the font directly e.g.:

segmentedControl.font = [NSFont systemFontOfSize:24];

To set the background color:

segmentedControl.wantsLayer = YES;
segmentedControl.layer.backgroundColor = [NSColor redColor].CGColor;