Implement tableview pull-down refresh and tableview pull-down refresh

Source: Internet
Author: User

Implement tableview pull-down refresh and tableview pull-down refresh
Implement drop-down refresh of tableview
Recommended third-party pull-down refresh code http://code4app.com/ios/%E5%BF% AB %E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
Does tableview sliding trigger this method?

-(Void) tableView :( UITableView *) tableView willDisplayCell :( UITableViewCell *) cell forRowAtIndexPath :( NSIndexPath *) indexPath {// if (indexPath) is triggered only when tableview is pulled down to the last row. row = self. m_data.count-1) {// define a UIViewUIView * footSpinnerView = [[UIView alloc] initWithFrame: CGRectMake (0.0f, 0.0f, 3200000f, 601_f)]; // view UIActivityIndicatorView * activity = [[UIActivityIndicatorView alloc] initWithFrame: CGRectMake (130.0f, 0.0f, 601_f, 601_f)]; activity. color = [UIColor redColor]; [activity startAnimating]; // start the view footSpinnerView with a new image. backgroundColor = [UIColor grayColor]; [footSpinnerView addSubview: activity]; // set footerview self. myTableView. tableFooterView = footSpinnerView; // self. myTableView. tableHeaderView = footSpinnerView; dispatch_queue_t queue = dispatch_queue_create ("my queue", nil); // Add data dispatch_async (queue, ^ (void) {[self. m_data addObject: @" 1000 "]; [self. m_data addObject: @" 1001 "]; [self. m_data addObject: @" 1002 "]; [self. m_data addObject: @" 1003 "]; [self. m_data addObject: @ "1004"] ;}); // reload the data after adding the data dispatch_async (queue, ^ (void) {sleep (2 ); dispatch_sync (dispatch_get_main_queue (), ^ (void) {[self. myTableView reloadData];}) ;}); // [self. myTableView reloadData]; dispatch_release (queue); [footSpinnerView release]; [activity release] ;}}

  

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.