Re: Auto center within a custom NSView
Re: Auto center within a custom NSView
- Subject: Re: Auto center within a custom NSView
- From: Lorenzo Thurman <email@hidden>
- Date: Sun, 02 Mar 2014 00:12:23 -0600
Thanks, I should have known that.
On Mar 1, 2014, at 11:55 PM, Kyle Sluder <email@hidden> wrote:
> On Sat, Mar 1, 2014, at 09:19 PM, Lorenzo Thurman wrote:
>> I have to add a variable number of NSSliders to a custom view, (although,
>> probably no more than eight). I’d like these items centered within the
>> view, but am unsure how to achieve this. I know I could probably “do the
>> math” and just calculate the position of each as its added, but I thought
>> I would ask on the list and see if anyone had any ideas as to how to go
>> about this. Given issues such as spacing between the sliders and padding
>> from the edges make the math route seem problematic.
>> Any ideas greatly appreciated.
>
> This is exactly why Auto Layout was invented.
>
> https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/Introduction/Introduction.html
>
> --Kyle Sluder
_______________________________________________
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