Skip to content

Trigger layoutSubviews when header toggled? #17

Description

@bensebborn

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions