• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSegmentedControl's sizing behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSegmentedControl's sizing behaviour


  • Subject: NSSegmentedControl's sizing behaviour
  • From: Graham Cox <email@hidden>
  • Date: Tue, 10 Nov 2015 14:36:51 +1100

I’m struggling to get the behaviour I want from NSSegmentedControl.

I want each segment to have the same width, which is the overall width of the control divided into equal parts. When the overall control is resized, the segment sizes should change, but remain equal to each other and fill the available width.

Currently, I can either set the segments to have ‘automatic’ width, which sets them to be just enough to fit their icon, or ‘fixed’ width which is maintained, but in both cases the control size remains fixed and never visually resizes with the enclosing view. Unless the enclosing view is just right, the control is either too narrow, or too wide and clipped off. I have no idea in what universe this behaviour is supposed to be useful.

Is there a way to set it up so it works how I want? I’m not using autolayout directly - the control is set to resize to its enclosing view using the classic struts to each side and a spring in the middle.


—Graham



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSSegmentedControl's sizing behaviour
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Another AppleScript-ObjC Bridge Question
  • Next by Date: Re: NSSegmentedControl's sizing behaviour
  • Previous by thread: Re: Instancetype and refactoring methods
  • Next by thread: Re: NSSegmentedControl's sizing behaviour
  • Index(es):
    • Date
    • Thread