一个表格视图只有一个行和允许多列水平滚动的多列
1、导入头文件
#import "WBTableView.h"
2、创建 WBTableView 实例
@implementation ViewController
{
WBTableView * _tableView;
}
...
...
_tableView = [[WBTableView alloc] init];
_tableView.delegate = self;
_tableView.dataSource = self;
3、WBTableViewDataSource
列的数量
- (NSInteger)numberOfItemsInTableView:(WBTableView *)tableView;
列的宽度
- (CGFloat)tableView:(WBTableView *)tableView widthForItemAtIndex:(NSInteger)index;
列的内容
- (WBTableViewCell *)tableView:(WBTableView *)tableView cellForItemAtIndex:(NSInteger)index
4、WBTableViewDelegate
选择列时的响应
- (void)tableView:(WBTableView *)tableView didSelectItemAtIndex:(NSInteger)index;