Prepare UX rework:

- enable the sticky headers in Rooms tab
This commit is contained in:
Giom Foret
2017-04-18 17:16:31 +02:00
parent 9c3e6692e6
commit 8be31c5df2
2 changed files with 4 additions and 38 deletions
@@ -454,44 +454,6 @@
sectionHeader.frame = frame;
[self.stickyHeadersBottomContainer addSubview:sectionHeader];
}
if (displayedSectionHeaders.count)
{
// Update the layout of the top sticky headers container
sectionHeader = displayedSectionHeaders.firstObject;
CGFloat containerHeight = 0;
for (UIView *header in _stickyHeadersTopContainer.subviews)
{
if (header.tag < sectionHeader.tag)
{
containerHeight += header.frame.size.height;
}
else
{
break;
}
}
self.stickyHeadersTopContainerHeightConstraint.constant = containerHeight;
// Update the layout of the bottom sticky headers container
sectionHeader = displayedSectionHeaders.lastObject;
containerHeight = 0;
CGRect bounds = self.stickyHeadersBottomContainer.frame;
for (UIView *header in _stickyHeadersBottomContainer.subviews)
{
if (header.tag == sectionHeader.tag + 1)
{
bounds.origin.y = header.frame.origin.y;
containerHeight = header.frame.size.height;
}
else if (header.tag > sectionHeader.tag + 1)
{
containerHeight += header.frame.size.height;
}
}
self.stickyHeadersBottomContainerHeightConstraint.constant = containerHeight;
self.stickyHeadersBottomContainer.bounds = bounds;
}
}
}