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

Implement layoutSubviews #13

Merged
merged 1 commit into from
Jul 31, 2013

Conversation

hSATAC
Copy link
Contributor

@hSATAC hSATAC commented Jul 31, 2013

Proposal

Implement layoutSubviews to recalculate frame according to subview of cell.ContentView

Symptom

The frames of cell and cell.ContentView is set during initialization. If we change the height of cell's content, there's no way to adjust the layout now.

All we have is reloadCollapseClick but this method will reset everything. We need a way to refresh the layout gracefully.

Scenario

The content view is generated programmatically according to some json API, so the height of this view is dynamic. We have to redraw this view and refresh layout of CollapseClick after a successful request.

Usage

// the content view frame has been changed.
test1View.frame = CGRectMake(0, 0, test1View.frame.size.width, test1View.frame.size.height + 50);

// tell CollapseClick to refresh layout.
[myCollapseClick setNeedsLayout];

bennyguitar added a commit that referenced this pull request Jul 31, 2013
@bennyguitar bennyguitar merged commit 7274207 into bennyguitar:master Jul 31, 2013
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