Well, since UITableView
is a subclass of UIScrollView
you could try to implement something like "floating view". To do this you should make sure
- The floating view is always the top most view in the hierarchy
- The position of the floating view should be updated when the
contentOffset
changes (so that visually it would float on top of other content when the user is scrolling)
You can try something like this (assuming that floatingHeaderViewCenter
is the initial center of the floatingView
:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
self.floatingHeaderView.center = CGPointMake(floatingHeaderViewCenter.x + scrollView.contentOffset.x, floatingHeaderViewCenter.y + scrollView.contentOffset.y);
[scrollView bringSubviewToFront:floatingHeaderView];
}
Although you'd better have a view container with two subviews: your tableview and the floating view.