• 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
Re: auto layout in a box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto layout in a box


  • Subject: Re: auto layout in a box
  • From: Roland King <email@hidden>
  • Date: Fri, 27 Nov 2015 12:08:16 +0800

Just tried it - worked fine as I would have expected.

Didn’t give the labels a fixed height, just constrained the top one to the top of the box, the bottom one to the bottom of the box and them to each other, all in the vertical direction. Had to pin the top corner of the box somewhere and give it a width constraint so it knew where to put it, but it resizes as you change the font on the labels.


> On 27 Nov 2015, at 11:44, Gerriet M. Denkmann <email@hidden> wrote:
>
> Xcode 7.1, OS X 10.10.5
>
> A xib with an NSBox which contains two Labels and the following vertical constraints:
>
> ^
> |		Default between Label1.Top and Superview.Top
> v
> Label1 	height = 17
> ^
> |		Default between Label1.Bottom and Label2.Top
> v
> Label2 	height = 14
> ^
> |	Default between Label2.Bottom and Superview.Bottom
> v
>
> The box has no height constraint - it is expected to fit it’s height to it’s content.
>
> But Xcode tells me that both Label1 and Label2 “Need constraints for: Y position or height”
>
> How can I persuade Xcode to work as expected?
>
> Gerriet.
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: auto layout in a box
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >auto layout in a box (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: Xcode won't let me add table to scene?
  • Next by Date: Re: auto layout in a box
  • Previous by thread: auto layout in a box
  • Next by thread: Re: auto layout in a box
  • Index(es):
    • Date
    • Thread