• 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
Constraints Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Constraints Question


  • Subject: Constraints Question
  • From: Eric Gorr <email@hidden>
  • Date: Sat, 29 Sep 2012 17:52:23 -0400

I am trying to wrap my head around the auto-layout functionality.

I have a sample project at:

	http://ericgorr.net/cocoadev/constraints.zip

After opening the project, take a look at ELGFirstViewController.xib.

This app will only be used in landscape.

On this XIB, there are three objects.

(1) A button
(2) A label
(3) A Table View

What I am looking to do is the following:

1. I want the table view to be a fixed height of 648 pixels. It should be the full width of it's superview and anchored at the bottom.
2. The label should be immediately above the table, with no vertical separation between it and the table view. It should also be the full width of the superview and it's height should remain fixed.
3. The button should be located at the right, with no vertical separation between it and the label. There should be no vertical separation between it and top of the super view. The height of the button is what I would like to be variable.

I have tried playing around with the height constraint of the button, lowering it's priority, but in every case, it is the height of the table view that shrinks.

How can I set up the constraints so the height of the button is variable? Is this possible to specify within IB or is the something I will need to do in code?



I can, of course, just fix the height of the button since I know how many pixels I will have remaining, but, again, I was interesting in learning something about auto-layout and was having trouble resolving this problem.


Thank you.




_______________________________________________

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: Constraints Question
      • From: Jonathan Hull <email@hidden>
  • Prev by Date: Re: The joy of unexpected SIGABRTs
  • Next by Date: Re: Constraints Question
  • Previous by thread: Re: NSPredicate / NSArray addObserver:forKeyPath:options:context: exception
  • Next by thread: Re: Constraints Question
  • Index(es):
    • Date
    • Thread