Pull to Refresh (ios)

前端 未结 8 1086
清酒与你
清酒与你 2020-12-07 22:08

I recently implemented pull to refresh here: https://github.com/leah/PullToRefresh. It kind of works however it gets stuck with a spinning activity indicator. Their is also

8条回答
  •  广开言路
    2020-12-07 22:40

    I am new to iOS development and I was trying to implement the pull to refresh in iOS 6. Well looking for a solution, I stumbled across this blog post and found it to be very helpful, http://www.intertech.com/Blog/Post/iOS-6-Pull-to-Refresh-(UIRefreshControl).aspx. It lays out the steps to implementing pull to refresh in a way that is easy to follow. Anyone looking to do this themselves in iOS 6 should check out the blog.

    The UIRefreshControl is only useable with a Table View currently. There are a few steps to follow to successfully add a refresh control:

    1. Create a callback method to handle your refresh logic. The callback method should be invoked when a user pulls down on the table view. The signarture of the method should take one parameter: a pointer to the UIRefreshControl.

    Note: Steps 2-4 are all done within the Table View Controller’s viewDidLoad method.

    2. Instantiate the UIRefreshControl with a basic "alloc/init".

    3. Connect an action to the refresh control to invoke your callback method when the ValueChange event is fired.

    4. Add the refresh control to the Table View Controller's "refreshControl" property.

提交回复
热议问题