TableView, pull-down effects are all over the street, and there are a lot of third-party code.
These two days have studied the principle, share the idea. Here take TableView's pull as an example, because the style of the pull-up operation is also many, here only one: in the pull-up tableview, under the bottom of tableview, add a view, the view can be customized. I call this view as Pullview,pullview dynamic, such as ( the figure shows only the loading state, in addition to the position of loading, there are "pull up show more", "Let go show more" and "no more" several status characters )
List out the basic state of Pullview, and the paths they convert to each other.
1. Pull the tableview up a little, and the "pull Up show more" appears
2. Continue to pull upward, beyond a certain distance, show "Let go to show more"; At this point the user can continue to pull up, the programmer to be in-(void) Scrollviewdidscroll: (Uiscrollview *) ScrollView The Pullview frame is constantly set so that Pullview can follow Scrollerview.
3. After letting go, show "Loading ..." (need to set the inset, that is, the scrollerview of the inset.bottom to become larger, so that the space to display Pullview. As far as inset ({64, 0, 56, 0}))
4. In the pull-up time did not let go, and pull back (no pause in the middle).
5. Continue to pull down until Pullview removes the screen.
6.loading is done to hide ( restore inset, but do not restore offset, otherwise there will be jitter, more detailed reference to jitter here)
7. In some cases skip the first step and enter the trigger state.
8. Show "No More" label
TableView pull-up, pull-down principle