• 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: Autolayout Greedy Fill question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autolayout Greedy Fill question


  • Subject: Re: Autolayout Greedy Fill question
  • From: Charles Srstka <email@hidden>
  • Date: Wed, 04 Dec 2013 17:37:42 -0600

On Dec 4, 2013, at 5:27 PM, Luther Baker <email@hidden> wrote:

> Given the following controls:
>
>    lastName = text field
>    gender = segmented control
>    picture = image view
>
> and given the following layout string:
>
>    @"V:|-[lastName]-[gender]-[picture]-|";
>
> I'd like to make sure that the lastName and gender controls are sized
> tightly and allows the "picture" control fill all remaining vertical space.
>
> Obviously, I don't want to include explicit size values.
>
> In other words, I want sizing similar to old school [lastName sizeToFit]
> and [gender sizeToFit] ... and then simply give the rest of the space to
> 'picture'.
>
> This question goes for the H axis as well. I have a series of elements on a
> line and I want to make sure that all of them are sized tightly save for
> one which should greedily take up the rest of the space.
>
> Please note that for the most part, these are built in controls - IE: I'm
> not overriding or implementing intrinsic size details.

Give lastName and gender a high value for "Content Hugging Priority", and you should get the behavior you want.

Charles



_______________________________________________

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: Autolayout Greedy Fill question
      • From: Luther Baker <email@hidden>
References: 
 >Autolayout Greedy Fill question (From: Luther Baker <email@hidden>)

  • Prev by Date: Autolayout Greedy Fill question
  • Next by Date: Re: Autolayout Greedy Fill question
  • Previous by thread: Autolayout Greedy Fill question
  • Next by thread: Re: Autolayout Greedy Fill question
  • Index(es):
    • Date
    • Thread