Skip to content
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

Fixed autolayout issues #1

Merged
merged 1 commit into from
Feb 16, 2014

Conversation

andreamazz
Copy link
Contributor

I changed line 79 from

CGFloat height = MAX(0, -y + maxY);

to

CGFloat height = MAX(1, -y + maxY);

to prevent an issue with autolayout:

2014-02-15 16:51:44.073 CSStickyHeaderFlowLayoutDemo[14879:70b] 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) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x14a40e90 h=-&- v=-&- UIView:0x9ae7620.height == UICollectionViewCell:0x9a23ee0.height - 0.5>",
    "<NSLayoutConstraint:0x9d4aa10 'UIView-Encapsulated-Layout-Height' V:[UICollectionViewCell:0x9a23ee0(0)]>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x9d4aa10 'UIView-Encapsulated-Layout-Height' V:[UICollectionViewCell:0x9a23ee0(0)]>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

jamztang pushed a commit that referenced this pull request Feb 16, 2014
Fixed autolayout constraints breakage when height became 0
@jamztang jamztang merged commit 45de173 into CSStickyHeaderFlowLayout:master Feb 16, 2014
@jamztang
Copy link
Collaborator

Hey @andreamazz thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants