I'm facing a constraints autolayout issue which is I have a UITableView at upper and UIView at lower. When the UITableView expand the tableView section, I want the UIView at the bottom shift down automatically, when collapse the tableView section, the UIView at bottom will move up automatically.
Below is my storyboard design, on the green sector is UITableView, on the red sector is UIView.
Your help is much appreciated.
Try use
ViewForHeaderSection
: title1, title 2... is tableview header section. When expandnumberofRowinsection = 1
and = 0 when collapse - your uiview is uitableview cell in section.Reload section when click section view.
don't worry and be happy. I have make a solution for you. Just simple thinking about your Layout and flow the steep below:
1.Your parent layout is ConstraintLayout,
2.Secondly take a RelativeLayout,
3.Then take another ConstraintLayout and
4.Finally add your "ExpandableListView" and your UI element
You can also see the code below:
Or you can also flow the Google Link: https://drive.google.com/open?id=0B-yo9VvU7jyBUHN6RHVXQmUtVU0
Add the IBOutlet of height constraints of your tableview.
control + drag and drop to the view controller. You will get the property like this.
Then call this one whenever you toggle the tableview.
contentSize
will calculate the tableview height and update the height to thetableviewHeightConstraints
constraints.