打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
iOS表格控件:TSTableView

iOS表格控件:TSTableView

您的评价:
     

 收藏该经验    
TSTableView是UI组件,用于显示多列的表格数据支持分层行和列的结构。它为项目的选择和动态内容修改提供了流畅的动画。下面列出了一些功能:
  • Suport muti columns data structure.
  • Support hierarchical column definition (i.e. column may have subsections).
  • Support hierarchical row definition (i.e. row may have expand subrows).
  • Optimized to display big sets of data: row and cell views are cached internally and reused during scrolling.
  • Support row and column selection.
  • Allow modification of column width by sliding column border.
  • Allow expand/collapse subrows content.
  • Support simple declarative syntax for columns and rows content definition.
  • Providing your own implementation of TSTableViewDataSource protocol will allow you fully customise structure and appearance of the table.
  • Default TSTableViewModel implements TSTableViewDataSource protocol and includes two built in styles (see screenshots).

 

下面提供示例的TSTableView对象实例化。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
NSArray *columns = @[
                     @{ @"title" : @"Column 1", @"subtitle" : @"This is first column"},
                     @{ @"title" : @"Column 2", @"subcolumns" : @[
                                @{ @"title" : @"Column 2.1", @"headerHeight" : @20},
                                @{ @"title" : @"Column 2.2", @"headerHeight" : @20}]},
                     @{ @"title" : @"Column 3", @"titleColor" : @"FF00CF00"}
                     ];
NSArray *rows = @[
                  @{ @"cells" : @[
                             @{ @"value" : @"Value 1"},
                             @{ @"value" : @1},
                             @{ @"value" : @2},
                             @{ @"value" : @3}
                             ]
                     },
                  @{ @"cells" : @[
                             @{ @"value" : @"Value 2"},
                             @{ @"value" : @2},
                             @{ @"value" : @3},
                             @{ @"value" : @4}
                             ]
                     }
                  ];
TSTableView *tableView = [[TSTableView alloc] initWithFrame:self.view.bounds];
tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
tableView.delegate = self;
[self.view addSubview:tableView];
TSTableViewModel  *dataModel = [[TSTableViewModel alloc] initWithTableView:tableView andStyle:kTSTableViewStyleDark];
[dataModel setColumns:columns andRows:rows];

项目主页:http://www.open-open.com/lib/view/home/1379212684756

相关资讯  — 更多

相关文档  — 更多
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
如何使用表格控件Spread for ASP.NET图表功能
「懒人IT学院」EXCEL和VBA技巧150例
Asp.Net Table控件动态生成表格操作实例(代码调试通过)
DataGridView控件用法(一)绑定数据
最简单的方法来实现下拉上拉刷新:MJRefresh
WinForm中DataGridView控件通过复选框实现多条记录的删除(转)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服