Giter Site home page Giter Site logo

walletsh / jxpagelistview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pujiaxin33/jxpagelistview

0.0 1.0 0.0 3.23 MB

高仿闲鱼、转转、京东、**天气预报等主流APP列表底部分页滚动视图

License: MIT License

Objective-C 100.00%

jxpagelistview's Introduction

JXPageListView

高仿闲鱼、转转、京东、**天气预报等主流APP列表底部分页滚动视图

特性

  • 上下左右滚动交互流畅;
  • 支持MJRefresh等header加载;
  • 支持HUD loading加载;
  • 支持底部分类滚动列表状态保存;
  • 支持底部分类滚动列表状态不保存;

效果预览

说明 GIF
上下左右交互
MJRefresh刷新加载
HUD loading加载
保存底部列表滚动状态
不保存底部列表滚动状态

使用

  • 初始化pageListView
self.pageListView = [[JXPageListView alloc] initWithDelegate:self];
  • 配置分类视图pinCategoryView
self.pageListView.pinCategoryView.titles = self.titles;
  • 成为mainTableView的代理,像使用普通UITableView一样使用它;
self.pageListView.mainTableView.dataSource = self;
self.pageListView.mainTableView.delegate = self;
  • UITableViewDataSource, UITableViewDelegate代理方法实现
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1 + “你的顶部内容section数量”;//底部的分类滚动视图需要作为最后一个section
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if (section == 2) {
        //Tips:最后一个section(即listContainerCell所在的section)需要返回1
        return 1;
    }
    //返回你的顶部内容 row number
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 2) {
        //Tips:最后一个section(即listContainerCell所在的section)返回listContainerCell的高度
        return [self.pageListView getListContainerCellHeight];
    }
     //返回你的顶部内容 cell height
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 2) {
        //Tips:最后一个section(即listContainerCell所在的section)配置listContainerCell
        return [self.pageListView configListContainerCellAtIndexPath:indexPath];
    }
   //返回你的顶部内容 cell
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    //Tips:需要传入mainTableView的scrollViewDidScroll事件
    [self.pageListView mainTableViewDidScroll:scrollView];
}
  • JXPageViewDelegate代理方法实现
//返回底部的列表视图
- (NSArray<UIView<JXPageListViewListDelegate> *> *)listViewsInPageListView:(JXPageListView *)pageListView {
    return self.listViewArray;
}

JXPagingView推荐

如果你只想找一个顶部只有少量视图(类似TableHeaderView的概念),推荐你看我的这个库:JXPagingView

JXCategoryView推荐

如果你想要支持所有主流APP分类切换效果的框架,推荐你看我的这个库,目前已经1.4k stars:JXCategoryView

补充

有任何疑问欢迎通过以下方式联系我:

jxpagelistview's People

Contributors

pujiaxin33 avatar

Watchers

James Cloos avatar

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.