How to scroll vertically but cell-by-cell in a table view
Hello,
I want to scroll just vertically in my tableview like everyone else, but i am wondering how i could do this by making every cell as large as the view,
and scroll the cells on their entire height, just like with the scrollview?
I want to make it feel like it's "magnetic per cell" when a user scrolls through the cells...
Or should i just use a scrollview with separate views?
I did some work on an app that did this, and the basic approach was:
1. Add an overlay view that detects touches.
2. Manually keep track of the current row index.
3. Process the touches. If swipe up, increment the index; swipe down, decrement.
4. Use scrollToRowAtIndexPath:atScrollPosition:animated: with your new index
No idea if this is the best approach. Also, actual tapping of the rows was not required in this case, which is good because the overlay view was intercepting touches. If you would need to select rows, you'd have to do some work correlating touch coordinates to table rows, and then triggering the select action yourself.
I want to scroll just vertically in my tableview like everyone else, but i am wondering how i could do this by making every cell as large as the view,
and scroll the cells on their entire height, just like with the scrollview?
I want to make it feel like it's "magnetic per cell" when a user scrolls through the cells...
Or should i just use a scrollview with separate views?
I think a scrollview would be easier to implement since it already provides the "magnetic" effect you are looking for.
i was thinking that scrollview ist the easiest too, but Brianslick's idea made me think about using the tableview again.
I could just as easily do it using the tableview without an extra overview layer. If i'd override the onclick functions i could stop anything from happening and detect the users scrollbehaviour. Then animate the cell scrolling up one or down one... sounds doable too.
i was thinking that scrollview ist the easiest too, but Brianslick's idea made me think about using the tableview again.
I could just as easily do it using the tableview without an extra overview layer. If i'd override the onclick functions i could stop anything from happening and detect the users scrollbehaviour. Then animate the cell scrolling up one or down one... sounds doable too.
Since UITableView inherits from UIScrollView, I wonder if there's a simple way to get the UITableView to behave the way you want just by changing the UIScrollView property.
the project where i am using this for is on ice for a couple weeks. I have heard some nice possibilities here. As soon as i get to this and have a working example, ill get back here to post it.
the project where i am using this for is on ice for a couple weeks. I have heard some nice possibilities here. As soon as i get to this and have a working example, ill get back here to post it.