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 necessary constraint being removed #7

Closed
wants to merge 1 commit into from

Conversation

izackp
Copy link
Contributor

@izackp izackp commented Jun 18, 2015

Had a problem while using aligning views inside of an autoresizable view.
The generated constraints for the OAStackView and it's subviews looked like this:
[View]-(0)-[View]-(0)-[View]-|

when it should look like:
|-[View]-(0)-[View]-(0)-[View]-|

@izackp
Copy link
Contributor Author

izackp commented Jun 19, 2015

NSArray *constraints = [self constraintsBetweenView:self andView:previousView inAxis:self.axis];
[self removeConstraints:constraints];

The code above removes the left and right constraints of the previousView.
The left constraint is never replaced only the right constraint is. This code creates a flag which determines if it is the previousView is the first view and replaces the missing constraint.

I don't know if this is the best way to fix this, but its working for me.

@nsomar
Copy link
Owner

nsomar commented Jun 23, 2015

Sorry for being late on this, I will definitely work on this tomorrow.

@nsomar
Copy link
Owner

nsomar commented Jun 24, 2015

Hey, I merged this branch from command line since I did a rebase on it. Now it works great.
Before closing this PR, can you confirm that current master solves your issue?

Thanks for your time :)

@Thomvis
Copy link
Contributor

Thomvis commented Jun 27, 2015

FWIW, I encountered layout issues that were solved by merging in the changes from this PR.

@izackp
Copy link
Contributor Author

izackp commented Jun 27, 2015

Sorry for the late response. Yea it works 👍

@nsomar
Copy link
Owner

nsomar commented Jun 27, 2015

I will be closing this as it seems to have solved @Thomvis and @izackp, thanks guys for your help :)

@nsomar nsomar closed this Jun 27, 2015
@izackp
Copy link
Contributor Author

izackp commented Aug 4, 2015

This problem is broken again (edit: nevermind, there was a bug with cocopods where :head was not pulling the latest commit. The simple solution was to update cocopods.)

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.

None yet

3 participants