Giter VIP home page Giter VIP logo

Comments (6)

liangdrime avatar liangdrime commented on May 22, 2024

如果你的item不重用的话,你直接在3,4个添加就行。如果采用的是相同的布局的item,使用了重用。你需要在数据源创建item之后的方法中根据index去设置你的refresh footer
例如:

- (UIScrollView *)swipeTableView:(SwipeTableView *)swipeView viewForItemAtIndex:(NSInteger)index reusingView:(UIScrollView *)view {
   MyTableView * tableView = view;
   // lazy load
   if (nil == tableView) {
        MyTableView * tableView =  [[MyTableView alloc]initWithFrame:swipeView.bounds style:UITableViewStylePlain];
        tableView.backgroundColor = [UIColor whiteColor];
        // config the tableview
        .....
   }
   [tableView setData:dataArray];
   // do something 
   .....
   // your refresh footer
   if (index == YourRefreshIndex) {
      tableView.refreshFooter = .......;          
   }else {
      tableView.refreshFooter = nil;
   }
   return tableView;
}

实现的大致逻辑可以参考这个,实际情况根据自己的项目略做调整

from swipetableview.

CoderJackie avatar CoderJackie commented on May 22, 2024

没有复用,是在创建item时设置footer?

- (ThirdTableView *)thirdTableView
{
    if (!_thirdTableView) {
        _thirdTableView = [[ThirdTableView alloc] initWithFrame:self.swipeTableView.bounds];
        _thirdTableView.footer = [MJRefreshAutoFooter footerWithRefreshingBlock:^{
            NSLog(@"上拉加载");
        }];
    }
    return _thirdTableView;
}

- (UIScrollView *)swipeTableView:(SwipeTableView *)swipeView viewForItemAtIndex:(NSInteger)index reusingView:(UIScrollView *)view {
    if (index == 0) {
        view = self.firstTableView;
        [view performSelector:@selector(reloadData)];
    } else if (index == 1) {
        view = self.secondScrollView;
    } else if (index == 2) {
        view = self.thirdTableView;

        [view performSelector:@selector(reloadData)];
    }

    return view;
}

from swipetableview.

liangdrime avatar liangdrime commented on May 22, 2024

恩,没有复用的话,在你自己的item中(或者创建你自己的item的时候)设置footer就行。

from swipetableview.

liangdrime avatar liangdrime commented on May 22, 2024

很抱歉,我不是很明白你的问题。你能否把你的这个demo发送到我的邮箱,然后我看一下问题吗?

2016-07-05 11:18 GMT+08:00 CoderJackie [email protected]:

而且只能加载出来一次数据,第二次继续上拉,不会调用block,滚动条也是异常的

[image: simulator screen shot 2016 7 5 11 17 54]
https://cloud.githubusercontent.com/assets/3355958/16573056/2b8f7850-42a2-11e6-9c7f-9a90e726d89f.png


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/APh73KhgYwcsW7D4duIlSXuboG0GzvOEks5qSc0AgaJpZM4JEt-5
.

from swipetableview.

CoderJackie avatar CoderJackie commented on May 22, 2024

你邮箱或者QQ是多少,我加你

from swipetableview.

liangdrime avatar liangdrime commented on May 22, 2024

[email protected],[email protected]

2016-07-05 13:47 GMT+08:00 CoderJackie [email protected]:

你邮箱或者QQ是多少,我加你


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#5 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/APh73KHjTCUrrvM0F9PzrskH9Jg8Tchlks5qSfAGgaJpZM4JEt-5
.

from swipetableview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.