分享

iOS表格控件:TSTableView

 quasiceo 2015-02-27

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

iOS表格控件:TSTableView

 

下面提供示例的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./lib/view/home/1379212684756

相关资讯  — 更多

相关文档  — 更多

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多