利用DTGridView实现横向滚动的tableview
来源:互联网 发布:微信运动图片 知乎 编辑:程序博客网 时间:2024/06/05 20:13
我们都知道tableview的实现原理,就是创建当前可见个数的tablecell,滚动过程中只是更改不可见的tablecell到可见的位置并且更新数据。这样可以避免滚动很多屏不用创建相应的视图,这样就不会造成内存泄漏。
下面是实现的效果图:
下面是实现的代码:
#pragma mark DTGridViewDataSource Methods
- (NSInteger)numberOfRowsInGridView:(DTGridView *)gv {
return 1;
}
- (NSInteger)numberOfColumnsInGridView:(DTGridView *)gv forRowWithIndex:(NSInteger)index {
return 20;
}
- (CGFloat)gridView:(DTGridView *)gv heightForRow:(NSInteger)rowIndex {
return gv.frame.size.height;
}
- (CGFloat)gridView:(DTGridView *)gv widthForCellAtRow:(NSInteger)rowIndex column:(NSInteger)columnIndex {
return gv.frame.size.width;
}
- (DTGridViewCell *)gridView:(DTGridView *)gv viewForRow:(NSInteger)rowIndex column:
(NSInteger)columnIndex {
return gv.frame.size.width;
}
- (DTGridViewCell *)gridView:(DTGridView *)gv viewForRow:(NSInteger)rowIndex column:(NSInteger)columnIndex {
MyTableCell *cell = (MyTableCell *)[gv dequeueReusableCellWithIdentifier:@"cell"];
if (!cell) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"MyTableCell" owner:self options:nil] objectAtIndex:0];
cell.identifier = @"cell";
}
[cell onShowCell];
return cell;
}
- 利用DTGridView实现横向滚动的tableview
- 利用DTGridView实现横向滚动的tableview
- 利用DTGridView实现横向滚动的tableview
- 横向滚动的tableview
- 横向TableVIew的实现
- 文字横向滚动的实现
- 文字横向滚动的实现
- iOS之tableView横向滚动
- 横向的TableVIew
- 横向的TableView
- 横向滚动图片,javascript实现的例子
- android 横向滚动文字的实现
- TextView 实现横向滚动的方法
- TextView 横向滚动效果的实现
- Tablayout 横向滚动条的简单实现
- gridview实现横向滚动
- RecyclerView实现横向滚动
- RecyclerView实现横向滚动
- oracle 内存三 data buffer
- pythonchalleng征程开启
- 懒了好久,感觉还是把自己不知道的都写下来,比较好……免得以后老呆故障,忘记了
- DBus学习笔记
- mysql中limit用法
- 利用DTGridView实现横向滚动的tableview
- linux列出一个目录及其子目录下面的某种类型的文件
- 头文件
- Advanced PHP Programming -- "require_once(Console/getopt.php) : failed to open stream" P129
- 重新规划你的人生——九条必看的职业规划箴言
- _wait_event 具体实现过程
- tmp分区大小不足的情况下,重新设定Linux 临时分区
- 使用AIDL实现进程间的通信 (转载liuhe688)
- qvfb怎么用