I have a rather complex view controller. It has a Segmented Control that switches between three child UITableViews. I'd like to mimic the behavior of the URL bar in the Safari app, where when you scroll up, the header disappears offscreen, but when you scroll down, it reappears without having to actually scroll all the way to the top of the table. I'm not sure what the proper term for this behavior is. How is this behavior usually accomplished?
Asked
Active
Viewed 50 times
1
-
I guess you are looking for `tableHeaderView` instead of `viewForHeaderInSection`. http://stackoverflow.com/questions/20982558/how-do-i-set-the-height-of-tableheaderview-uitableview-with-autolayout – Mohammad Zaid Pathan Jun 28 '16 at 11:28
-
How does that work with three different tableviews? – GoldenJoe Jun 28 '16 at 20:09
-
If your cells are same for all 3 tableViews then no need to take 3 tableViews,just have 3 dataSource and set according to which tab is selected. – Mohammad Zaid Pathan Jun 29 '16 at 03:55
-
Cells in each table are different, though that doesn't necessarily matter. I could still check for the selected tab in cellForRowAtIndexPath. The main problem here is that hide/show behavior. – GoldenJoe Jun 29 '16 at 04:15
-
You can reload your table with animation so that may help you in hide/show behaviour. – Mohammad Zaid Pathan Jun 29 '16 at 04:45