-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional UIViews below last UILabel produce autolayout warnings #5
Comments
Can you share the Auto Layout exceptions being logged? I'm pretty sure the ones you are seeing are exceptions when the cell is first created with a default height of 44 pt. Did you see this commented area in the code?
|
Thanks Smileyborg, I've posted the exceptions below. There aren't any "default size {320, 44}" exceptions, but many of the "Unable to simultaneously satisfy constraints" ones. Other than the lines I've shown on my previous post, I've left everything as per your code in github... so to be sure it wasn't something else I did messing it up :-). It shows the exception with and without the estimatedHeightForRowAtIndexPath with a default height of 44 pt. Interestingly... if I comment out this line... You were right when mentioning that the AutoLayout was the hardest part of getting this to work correctly. Dan, 2014-08-20 07:26:40.849 TableViewCellWithAutoLayout[18416:560257] 17545849:_UIScreenEdgePanRecognizerEdgeSettings.edgeRegionSize=13.000000 Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. |
@dformoso The pasted exception console output looks like it's missing all the useful info:
The output above should show the details (description) for each constraint - instead it's just showing empty quotes. Can you please check that you copy-pasted these correctly? In any case, this is the type of console output you will get if your cell requires a height larger than the default height of 44 pt. Basically, if you add up all the vertical padding amounts as well as the heights of any views with Required priority, and these exceed the height of the cell/contentView at any point in time, you're going to see these exceptions. This is because the table view cell height isn't calculated and set to the appropriate size until after doing one layout pass, and during this first layout pass the cell is at its default size (44 pt) which may not be tall enough to fit everything without breaking a Required-priority constraint. Therefore, you will get these exceptions. Did you try uncommenting the one line of code suggested to see if that resolves the exceptions?
|
That last line fixed it. Again, many thanks for your help.! |
Hi smileyborg, this saves a TON of time... Can't thank you enough.
Can you help me with a problem I'm having? I am running into autoLayout problems when trying to add an additional object to the sample code on iOS8. It's probably me doing something wrong.. But I just can't see it.
Creating a UIView under the bottom UILabel and giving the autoLayout constraints below will display correctly, but with lots of autoLayout warnings followed by an attempt to break constraint...
Can you help me figure out what am I doing wrong?
The text was updated successfully, but these errors were encountered: