NSSegmentControl Images Scaling Not Working

100 Views Asked by At

The problem appears specifically when using an NSSegmentControl and in the segments inside images are placed (set via StoryBoard). Furthermore it only happens when using a Retina MacBook and if you're NOT connected to a second monitor.

When the above conditions are met the images render at larger sizes than they should. You can reproduce the problem by creating a new Project in XCode, dropping an NSSegmentControl in its ToolBar and then adding an image, like "NSBonjour" or "NSCaution". It does not happen for some other images like "NSStatusNone"

I believe this may be a bug, problem is I'm not entirely sure and how can I fix this in my app. I have no idea and found no information online.

Any help appreciated,

Thanks!

enter image description here

enter image description here

enter image description here

1

There are 1 best solutions below

0
MMV On

I've found the problem, apparently images in segmented control must have different image sizes vs. normal buttons.

They should be:

19x19 at 1x 38x38 at 2x 57x57 at 3x

Hope this helps future devs.

Regards,

Marc