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 issues with invalid cell layout #10

Merged
merged 2 commits into from
Apr 23, 2014
Merged

Conversation

paweldudek
Copy link
Contributor

This small change fixes an issue with multi value section having invalid layout on iPad when a new row is added.

Form table view cells use auto layout for laying out subviews, however the call after cell configuration used old

setNeedsLayout

call to inform the cell that it should update its layout. This was changed to

setNeedsUpdateConstraints

Example image how it looked before the fix:

screen shot 2014-04-22 at 5 51 04 pm

@mtnbarreto
Copy link
Member

hey @paweldudek ,
Thanks for the contribution. Maybe we should keep setNeedsLayout to support UItableViewCells that don't use autolayout.

I mean,

[cell setNeedsUpdateConstraints];
[cell setNeedsLayout];

instead of

[cell setNeedsUpdateConstraints];

Could you please make another pull request adding this line? Also make sure it works on your ipad app.

I will add tests and an ipad example soon.

@paweldudek
Copy link
Contributor Author

I'm a huge fan of 'don't write code that's not yet needed' (and removing the setNeedsLayout call didn't affect other existing cells), but if you insist ;)

I've added the

setNeedsLayout

call. And yes, it does work on iPad.

mtnbarreto pushed a commit that referenced this pull request Apr 23, 2014
Fixed issues with invalid cell layout
@mtnbarreto mtnbarreto merged commit d54a42c into xmartlabs:master Apr 23, 2014
This pull request was closed.
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