In my app I have a UITableView
with a UIView
placed above its frame:
-----------
| UIView |
-----------
| |
| |
|UITableView|
| |
| |
-----------
When I scroll the tableView
up the UIView
is pushed up out of the screen and when the contents of the tableView
are scrolled down the UIView
gets pushed back into the screen. All the movement of the UIView
happens with the same speed as the user scrolls. So if the user scroll 10px the UIView is only moved 10px.
The problem I am having is the resizing of the tableView
. I want it to resize according to the y-position of the UIView so that there is never any space between then.
The moving of the UIView
is working perfectly but the resizing of the tableView
not at all. I really freezes up the main thread and it is really edgy.
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
Some code for moving the UIView...
UpdateFrameY(_tableViewController.tableView, diff);
UpdateFrameHeightOnDiff(_tableViewController.tableView, diff);
}
Is there a better way I can do this? I am actually trying to copy this behavior from the FB app. It works really smoothly there. Thanks a lot!