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

Trigger layoutSubviews when header toggled? #17

Open
bensebborn opened this issue Oct 23, 2015 · 0 comments
Open

Trigger layoutSubviews when header toggled? #17

bensebborn opened this issue Oct 23, 2015 · 0 comments

Comments

@bensebborn
Copy link

I am using this table within an autolayout setup with Storyboard. Each of my rows has a diferent height, so when I toggle the sections, the overall table height changes.

I have managed to get around this by using:

-(void)viewDidLayoutSubviews{

CGFloat height = self.infoTableView.contentSize.height - 20.0f; //- 200.0f;
    self.infoTableHeightConstraint.constant = height;
}

The initial view loads, and the table will size correctly, based on the content currently showing. This also works if I expand a section within viewDidLoad.

However, if I then press on a section header, and the sections then toggle, the tableheight doesn't adjust the surrounding views, etc so the content is hidden. It seems that clicking the header and triggering the toggle doesn't cause the view to layoutSubviews, so the above is not called

Is there a way we can trigger this, so the layout will adjust to the new size?

Thanks

H

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

1 participant