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

unable to simultaneously satisfy constraints warnings #27

Open
iAj43 opened this issue Aug 18, 2017 · 6 comments
Open

unable to simultaneously satisfy constraints warnings #27

iAj43 opened this issue Aug 18, 2017 · 6 comments

Comments

@iAj43
Copy link

iAj43 commented Aug 18, 2017

First of all, tnx a lot for this awesome implementation programmatically. Here my question is I don't why but whenever I add other subviews and add constraints or modified constraints with respect to other subviews, initially it doesn't throws any warnings but when I tapped on the section the warnings shows on console.
The project runs successfully, but I want to know why the above warnings shows every time when I tapped on section?
thanks again...

@phoney
Copy link

phoney commented Sep 19, 2017

I think that during the animation to expand/contract the sections are set to a height and width of zero. The only way I found to fix the warnings is to the set the priority of one of the horizontal and one of the vertical constraints to a priority of 750.

@224XS
Copy link

224XS commented Nov 7, 2017

Jeantimex! Great job! Nice approach to this issue. However, this auto layout issue still exists in Xcode 9.1 and Swift4 (iOS 11) when running the current demo. The supposed fix in closed issue 17 merely shuts off debugger logging, but does not actually fix the problem. Neither does lowering layout priority in the bottom and right constraints to the margin guides. Any thoughts

My solution is to turn off the bottom and training contraints in the CollapsibleTableViewHeader.Init

arrowLabel.bottomAnchor.constraint(equalTo: marginGuide.bottomAnchor).isActive = false
and

        titleLabel.trailingAnchor.constraint(equalTo: marginGuide.trailingAnchor).isActive = false
        titleLabel.bottomAnchor.constraint(equalTo: marginGuide.bottomAnchor).isActive = false

No ill effects noted in the resulting table format

@piggeldi
Copy link

Instead of reload sections, just insert or delete the rows of the given section. Then the sectionHeader will not redraw.

That should fix the problem.

@224XS
Copy link

224XS commented Nov 17, 2017 via email

@AdminOfUbriter
Copy link

@224XS One day you may find a title string is so long that overlaps with arrow when there is no trailing constraint.

@emreond
Copy link

emreond commented Oct 3, 2018

Hello, thanks for the great share. Will it be a problem on usage? Like getting crash or smoth?

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

No branches or pull requests

6 participants