ios - Move a view when scrolling in UITableView -
i have uiview uitableview below it:

what have view above uitableview move (out of way) when user starts scrolling in table in order have more space uitableview (and come down when scroll down again).
i know done table header view, problem table view inside tab (actually side-scrolling page view implemented using ttsliddingpageviewcontroller). while have 1 top uiview there 3 uitableviews.
is possible accomplish manually? first thought put in uiscrollview, according apple's documentation 1 should never place uitableview inside uiscrollview leads unpredictable behavior.
since uitableview subclass of uiscrollview, table view's delegate can receive uiscrollviewdelegate methods.
in table view's delegate:
- (void)scrollviewdidscroll:(uiscrollview *)scrollview { static cgfloat previousoffset; cgrect rect = self.view.frame; rect.origin.y += previousoffset - scrollview.contentoffset.y; previousoffset = scrollview.contentoffset.y; self.view.frame = rect; }
Comments
Post a Comment