All Projects → bestDew → ZKTreeTableView

bestDew / ZKTreeTableView

Licence: other
A view of the tree structure.树状结构列表。

Programming Languages

objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to ZKTreeTableView

React Native Largelist
The best large list component for React Native.
Stars: ✭ 2,153 (+2119.59%)
Mutual labels:  tableview
Dropdownmenukit
UIKit drop down menu, simple yet flexible and written in Swift
Stars: ✭ 246 (+153.61%)
Mutual labels:  tableview
XTableView
一个基于RecyclerView+Scroller实现的二维表格组件,同时支持侧滑菜单、拖动调整列表顺序等拓展功能。A two-dimensional table view, base on recyclerview, both support to side slide menu、drag item and more.
Stars: ✭ 15 (-84.54%)
Mutual labels:  tableview
Swipetableview
Both scroll horizontal and vertical for segment scrollview which have a same header. — 类似半糖、美丽说主页与QQ音乐歌曲列表布局效果,实现不同菜单的左右滑动切换,同时支持类似tableview的顶部工具栏悬停(既可以左右滑动,又可以上下滑动)。兼容下拉刷新,自定义 collectionview实现自适应 contentSize 还可实现瀑布流功能
Stars: ✭ 2,252 (+2221.65%)
Mutual labels:  tableview
Tqmultistagetableview
TQMultistageTableView是一个分3层的列表控件
Stars: ✭ 232 (+139.18%)
Mutual labels:  tableview
stringify-keys
Build an array of key paths from an object.
Stars: ✭ 18 (-81.44%)
Mutual labels:  expand
Swform
iOS 高度封装自适应表单(重构版)
Stars: ✭ 159 (+63.92%)
Mutual labels:  tableview
react-native-js-tableview
A JavaScript implementation for TableView that looks great on both iOS and Android.
Stars: ✭ 23 (-76.29%)
Mutual labels:  tableview
Rxdatasources
UITableView and UICollectionView Data Sources for RxSwift (sections, animated updates, editing ...)
Stars: ✭ 2,784 (+2770.1%)
Mutual labels:  tableview
SUBLicenseViewController
✒ CocoaPod for attributing open source software! https://insanj.github.io/SUBLicenseViewController/
Stars: ✭ 15 (-84.54%)
Mutual labels:  tableview
Circleoffriendsdisplay
朋友圈的做法
Stars: ✭ 205 (+111.34%)
Mutual labels:  tableview
Magearrefreshcontrol
An iOS refresh control with gear animation
Stars: ✭ 231 (+138.14%)
Mutual labels:  tableview
elm-arborist
Parameterized 🌲tree🌲-editor for Elm
Stars: ✭ 57 (-41.24%)
Mutual labels:  tree-structure
React Native Cell Components
Awesome react-native cell components! From a Cell to more complex & awesome components.
Stars: ✭ 177 (+82.47%)
Mutual labels:  tableview
ng-treetable
A treetable module for angular 5
Stars: ✭ 32 (-67.01%)
Mutual labels:  tree-structure
Tqtableviewcellremovecontroller
A table view cell remove animation with FBPOP
Stars: ✭ 166 (+71.13%)
Mutual labels:  tableview
Reactivelists
React-like API for UITableView & UICollectionView
Stars: ✭ 250 (+157.73%)
Mutual labels:  tableview
ffiler
File Filer; sort files into structured directory tree. Tree can be structured based on various designs such as date (file modification time), file hash, file prefix etc
Stars: ✭ 45 (-53.61%)
Mutual labels:  tree-structure
mongodb-tree-structure
Implementing Tree Structure in MongoDB
Stars: ✭ 14 (-85.57%)
Mutual labels:  tree-structure
youtube discussion tree
This is a python API that allows you to obtain the discusion that occurs on the comments of a Youtube video as a tree structure. It also controls the quota usage that consumes your implementation over Youtube Data Api through this library, and allows you to represent and serialize the discusion tree.
Stars: ✭ 16 (-83.51%)
Mutual labels:  tree-structure

⚠️已停止维护,使用需谨慎⚠️


ZKTreeListView

树状结构列表

重要事项

构建一个树结构,需要一些必要的参数:
ID:当前节点唯一标识
parentID:即为父节点的ID
sortOrder:层级内子节点序号,用于排序

框架结构

本框架主要包含四大类:

  • ZKTreeNode:节点数据模型。用于将原始数据转化为节点数据模型

  • ZKTreeManager:数据模型管理类。核心类,用于构建树结构,提供对节点数据的增、删、改、查功能(非线程安全)

  • ZKTreeListViewCell:cell视图类。自定义cell时需继承此类

  • ZKTreeListView:主视图类。用于将数据操作可视化

代码示例

// ...初始化ZKTreeListView,并设置其代理
// ...实现其代理方法:- (ZKTreeListViewCell *)treeListView:(ZKTreeListView *)listView cellForNode:(ZKTreeNode *)node    atIndexPath:(NSIndexPath *)indexPath;
// ...网络请求拿到原始数据:dataArray

NSMutableArray *nodes = @[].mutableCopy;
for (NSDictionary *data in dataArray) {
    // 1.字典转模型(你自己的数据模型)
    Model *model = [Model modelWithDict:data];
    // 2.构建节点数据模型
    ZKTreeNode *node = [ZKTreeNode nodeWithID:ID parentID:pID sortOrder:sortOrder data:model];
    // 后台未返回level时,可不设置,内部会自动计算
    node.level = level;
    /**
    框架目前暂不支持自适应行高,建议提前计算好行高,有助于提升性能
    注意:行高的计算依赖于level,若后台未返回level,此项可不设置,通过以下代理方法返回行高(此时level已内部自动设置):
    - (CGFloat)treeListView:(ZKTreeListView *)listView rowHeightForNode:(ZKTreeNode *)node atIndexPath:(NSIndexPath *)indexPath
    此代理方法会在每次返回时为node.rowHeight赋值,避免重复计算带来的性能消耗
    */
    node.rowHeight = rowHeight;
    // 如需子节点分页显示,可设置此项,需后台返回每个节点的子节点总数
    node.childNodesCount = [model.childs_count integerValue];
    
    [nodes addObject:node];
}
// 3.加载数据
/**
若首次加载数据,使用:[_listView loadNodes:nodes];
若在根节点追加数据,比如上拉加载更多可以使用:[_listView appendNodes:nodes]; 或 [_listView appendChildNodes:nodes node:nil];两种方式
两种方法的区别是:-appendNodes:分组,而 -appendChildNodes:node:不会;在根节点追加数据时推荐使用前者,在子节点追加数据时只能使用后者
*/

详细使用参见Demo,注释写得很清楚。

不足

由于树状结构列表使用范围较窄,并且与业务耦合严重,所以框架目前的可定制化程度不高。如果本框架不能满足项目需求,可将 ZKTreeNode 和 ZKTreeManager 单独抽离使用,自己去实现视图类。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].