用于代替 UITableView 的水平表格视图,使用起来非常简单
使用 UIHorizontalTableView 就像使用 UItableView 一样
@interface ViewController ()<UIHorizontalTableViewDelegate, UITableViewDataSource>
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIHorizontalTableView* h1 = [[UIHorizontalTableView alloc] initWithFrame:(CGRect){0,50,self.view.bounds.size.width, 50}];
[self.view addSubview:h1];
h1.hDataSource = self;
h1.hDelegate = self;
[h1 registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
}
@end