• 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
Still can't get autolayout to work the way I want
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Still can't get autolayout to work the way I want


  • Subject: Still can't get autolayout to work the way I want
  • From: Rick Mann <email@hidden>
  • Date: Thu, 19 Sep 2013 14:45:59 -0700

Xc5, iOS 7, simulator.

I have a popover that comes up fine. But when I click on a cell, and it segues to the next scene, it then grows the popover in width to fill the iPad screen.

The target scene is a static table view. It has two custom cells with labels in one group, and a cell used as a button:

	http://cl.ly/image/0Z3R2M0a1T0m

I don't know of any easy way to show the constraints, but the labels have fixed width and height, baselines are aligned, the editable fields are vertically centered and have fixed height, and left, middle, and right space is fixed.

If the editable field widths are left unconstrained, the whole thing grows. If I try to constrain the width, I get unsatisfiable constraints, it breaks the width constraint, and then grows the popover only a little in width:

2013-09-19 14:41:15.303 MatterScan[5864:a0b] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
    "<NSLayoutConstraint:0xc9c8620 H:[UILabel:0xc99aba0(67)]>",
    "<NSLayoutConstraint:0xc9bfd80 H:[UITextField:0xc9d65c0(277)]>",
    "<NSLayoutConstraint:0xc9b6a10 H:[UITextField:0xc9d65c0]-(NSSpace(20))-|   (Names: '|':UITableViewCellContentView:0xc9b2ca0 )>",
    "<NSLayoutConstraint:0xc9b6a60 H:[UILabel:0xc99aba0]-(6)-[UITextField:0xc9d65c0]>",
    "<NSLayoutConstraint:0xc9bb000 UILabel:0xc99aba0.leading == UITableViewCell:0xc9acb60.leading + 20>",
    "<NSAutoresizingMaskLayoutConstraint:0xb6b0800 h=--& v=--& UITableViewCellContentView:0xc9b2ca0.midX == + 264>",
    "<NSAutoresizingMaskLayoutConstraint:0xb6b0aa0 h=--& v=--& H:[UITableViewCellContentView:0xc9b2ca0(528)]>",
    "<NSAutoresizingMaskLayoutConstraint:0xb6b10d0 h=-&- v=-&- UITableViewCellScrollView:0xc9aa890.midX == UITableViewCell:0xc9acb60.midX>",
    "<NSAutoresizingMaskLayoutConstraint:0xb6b0f80 h=-&- v=-&- UITableViewCellScrollView:0xc9aa890.width == UITableViewCell:0xc9acb60.width>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0xc9bfd80 H:[UITextField:0xc9d65c0(277)]>


I am never able to get this shit right 100% of the time, and I don't know if it's because I'm doing something wrong, or iOS is broken and I need to do something else.

Any ideas?

--
Rick




_______________________________________________

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: Still can't get autolayout to work the way I want
      • From: "Brad O'Hearne" <email@hidden>
  • Prev by Date: Re: Window controllers and memory leaks
  • Next by Date: Re: Still can't get autolayout to work the way I want
  • Previous by thread: Re: iOS Calendar Question
  • Next by thread: Re: Still can't get autolayout to work the way I want
  • Index(es):
    • Date
    • Thread