GithubHelp home page GithubHelp logo

liuchangjun666 / wstableviewtree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wuyuedefeng/wstableviewtree

1.0 0.0 0.0 20.02 MB

可折叠展开的tableview, tableview folder.你可以像定义普通cell一样定义subrow的cell进行自定义美化

Objective-C 100.00%

wstableviewtree's Introduction

WSTableviewTree

##运行demo 运行demo


###该框架可以自定义二级cell伸展,折叠,使用方法和原生方法基本一样 不需要任何学习成本

该项目自定义拓展的tableview的代理方法
- (NSInteger)tableView:(WSTableView *)tableView numberOfSubRowsAtIndexPath:(NSIndexPath *)indexPath;
- (CGFloat)tableView:(WSTableView *)tableView heightForSubRowAtIndexPath:(NSIndexPath *)indexPath;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForSubRowAtIndexPath:(NSIndexPath *)indexPath
- (BOOL)tableView:(WSTableView *)tableView shouldExpandSubRowsOfCellAtIndexPath:(NSIndexPath *)indexPath

###注意

tableview的cell必须继承WSTableViewCell, subCell不能继承WSTableViewCell,WSTableViewCell中的expandable属性用于区别,cell属于一级cell还是二级cell!!

###用途简介 ##比如 写过的样式

##使用方法 ######创建tableview数据源最好使用提供的WSTableviewDataModel(该model定义了一级标签所显示的字符串,和存放二级标签对象的数组,可以任意继承该类进行任意拓展)

```objective-c
_dataSourceArrM = [NSMutableArray array];
WSTableviewDataModel *dataModel = [[WSTableviewDataModel alloc] init];
dataModel.firstLevelStr = @"医院选择";
dataModel.shouldExpandSubRows = NO; //默认收缩数据(不设置默认为NO)
[dataModel object_add_toSecondLevelArrM:@"医院1"];
[dataModel object_add_toSecondLevelArrM:@"医院2"];
[dataModel object_add_toSecondLevelArrM:@"医院3"];
[dataModel object_add_toSecondLevelArrM:@"医院4"];
[_dataSourceArrM addObject:dataModel];

WSTableviewDataModel *dataModel2 = [[WSTableviewDataModel alloc] init];
dataModel2.firstLevelStr = @"部位选择";
dataModel2.shouldExpandSubRows = YES; //默认显示数据
[dataModel2 object_add_toSecondLevelArrM:@"腿"];
[dataModel2 object_add_toSecondLevelArrM:@"脚"];
[_dataSourceArrM addObject:dataModel2];

WSTableviewDataModel *dataModel3 = [[WSTableviewDataModel alloc] init];
dataModel3.firstLevelStr = @"部位选择2";
[dataModel3 object_add_toSecondLevelArrM:@"腿2"];
dataModel3.expandable = NO; //不允许展开数据
[_dataSourceArrM addObject:dataModel3];

WSTableviewDataModel *dataModel4 = [[WSTableviewDataModel alloc] init];
dataModel4.firstLevelStr = @"部位选择3";
[_dataSourceArrM addObject:dataModel4];
```

###更多拓展tableview方法请查看WSTableView头文件

wstableviewtree's People

Contributors

wuyuedefeng avatar

Stargazers

Liuchangjun 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.