一个静态UITabelView的解决方案----CTStaticTableView
2015-06-12 16:47
459 查看
CTStaticTableView
这是一个用代码封装静态TableView的方式。你可以用xib初始化CTStaticTableView,也可以用代码:
self.tableView = [[CTStaticTableView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)]; [self.view addSubview:self.tableView];
然后可以合成你的static table view cell
需要两个参数:一个是TableViewCell对象,一个是他的高度。
CTStaticTableViewCell *fristStaticCell = [CTStaticTableViewCell staticTableViewCellWithCell:[DemoTableViewFristCell fristCell] height:50]; CTStaticTableViewCell *secendStaticCell = [CTStaticTableViewCell staticTableViewCellWithCell:[DemoTableViewSecendCell secendCell] height:80];
拼起来吧
[self.tableView showStaticCells:@[fristStaticCell, secendStaticCell]]; //或者 [self.tableView showStaticCells:@[fristStaticCell, secendStaticCell] withDidSelectRowDelegate:self]; //或者 [self.tableView showStaticCells:@[fristStaticCell, secendStaticCell] withDidSelectRowBlock:^(NSIndexPath *indexPath) { NSLog(@"taptaptap"); }];
没了,请看demo代码。
https://github.com/chentoo/CTStaticTableView
相关文章推荐
- android Runnable建立线程,与UI、activity信息的传送
- [LeetCode] Longest Consecutive Sequence
- UIView全部API的学习。
- Administrator privileges required for OLE Remote Procedure Call debugging: this feature will not wo
- easyui的datagrid动态列
- Android Phone Pad UI设计主流分辨率
- 【uiautomator】输入中文(输入法安装+测试代码)
- 基于Java Bean Validation对Request参数进行校验的设计思路
- ngui屏幕自适应
- LeetCode63:Unique Paths II
- easyUI 鼠标悬停显示内容
- 20大UI设计原则
- GRE Issue写作范文Topic123
- db file sequential read 详解
- Uva - 540 - Team Queue
- Uva - 540 - Team Queue
- Burp Suite使用介绍(一)
- 2014年10月12日GRE考试issue作文题及参考范文
- Android多线程编程详解,关于Handler ,Looper , Message , MessageQueue
- IOS代码实现常用控件UIButton、UISlider、UISwitch、UISegmentedControl