Re: Auto layout without ambiguity
Re: Auto layout without ambiguity
- Subject: Re: Auto layout without ambiguity
- From: Roland King <email@hidden>
- Date: Sun, 02 Nov 2014 10:01:52 +0800
> On 2 Nov 2014, at 12:17 am, Gerriet M. Denkmann <email@hidden> wrote:
>
> 10.10
>
> From left to right:
>
> fixed distance from super view
> Label
> fixed distance
> TextField (this should be ≥ something, otherwise fitting to content)
> fixed distance
> Label
> variable distance (≥ some minimum)
> Button
> fixed distance to super view
>
> When I set the width of TextField to ≥ something, Xcode (6.1) complains about ambiguity.
> I tried to set the horizontal content hugging value of the TextField to max (1000) but still get ambiguity.
>
> So I have to set width of TextField to = something, which does not look very nice.
>
> How to solve this?
Textfields don’t have intrinsic content size, so the content hugging etc makes no difference. Neither does ‘space’. So you have two things in the line which have an inequality but don’t have the constraints of lower rank which content hugging etc add in. Which makes the layout ambiguous.
Fix the second distance instead of making it variable and make the label of variable width (>=) and left or right align it so it’s effectively the same as having a variable space. That should work.
_______________________________________________
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