Re: Aligning baseline of NS controls
Re: Aligning baseline of NS controls
- Subject: Re: Aligning baseline of NS controls
- From: Ken Thomases <email@hidden>
- Date: Thu, 10 Jul 2014 10:34:15 -0500
On Jul 10, 2014, at 9:03 AM, Keary Suska <email@hidden> wrote:
> On Jul 10, 2014, at 2:02 AM, Aandi Inston wrote:
>
>> Suppose a dialog is to contain a line with multiple controls like
>>
>> [ ] Add ________ seconds [before/after]
>> Each of these controls contains text, and the aim here is to align the text
>> so it does not jump up and down - to align the text baseline.
>
> Umm, Auto Layout? You can easily align elements by baseline...
And even if you don't use auto layout as such, there were methods introduced to support it that you can use anyway. In particular, -[NSView alignmentRectForFrame:] to get the alignment rectangle and -baselineOffsetFromBottom to find the baseline relative to that alignment rectangle.
Regards,
Ken
_______________________________________________
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