Search code examples
objective-ccocoaheightnssegmentedcontrol

How to adjust the height of NSSegmentControl?


The height of NSSegmentControl can't be adjusted.

Is there anyone who knows how to do it?

Please let me know. Many thanks.


Solution

  • An NSSegmentedControl object implements a horizontal button made of multiple segments. And also it does not provide any APi to set the height. But you can set the width using - (CGFloat)widthForSegment:(NSInteger)segment. The only thing you can do is to set different styles using below api.. - (void)setSegmentStyle:(NSSegmentStyle)segmentStyle