UITableView设计思想 考察
2017-08-15 11:06
260 查看
整体使用了build模式;单是组织结构混乱;不符合人类思维。
UITableViewDataSource:描述了View的要素个数情况;并担负了builder功能。
UITableViewDelegate:描述了要素的几何属性(组织者)并担负了builder功能。
UITableView
@property (nonatomic, strong, nullable) UIView *tableHeaderView; // accessory view for above row content. default is nil. not to be confused with section header
@property (nonatomic, strong, nullable) UIView *tableFooterView; // accessory view below content. default is nil. not to be confused with section footer
==========================================
this represents the display and behaviour of the cells.
UITableViewDelegate
// Variable height support
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
// Section header & footer information. Views are preferred over title should you decide to provide both
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section; // custom view for header. will be adjusted to default or specified header height
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section; // custom view for footer. will be adjusted to default or specified footer height
// Called after the user changes the selection.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(3_0);
// this protocol represents the data model object. as such, it supplies no information about appearance (including the cells)
UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
UITableViewDataSource:描述了View的要素个数情况;并担负了builder功能。
UITableViewDelegate:描述了要素的几何属性(组织者)并担负了builder功能。
UITableView
@property (nonatomic, strong, nullable) UIView *tableHeaderView; // accessory view for above row content. default is nil. not to be confused with section header
@property (nonatomic, strong, nullable) UIView *tableFooterView; // accessory view below content. default is nil. not to be confused with section footer
==========================================
this represents the display and behaviour of the cells.
UITableViewDelegate
// Variable height support
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
// Section header & footer information. Views are preferred over title should you decide to provide both
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section; // custom view for header. will be adjusted to default or specified header height
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section; // custom view for footer. will be adjusted to default or specified footer height
// Called after the user changes the selection.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(3_0);
// this protocol represents the data model object. as such, it supplies no information about appearance (including the cells)
UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
相关文章推荐
- 借鉴系统UITableView的设计思想,自定义一个"花瓣"菜单
- 讲解iOS开发中UITableView列表设计的基本要点
- iOS设计之 表格UITableView 的参数与视图页面之间的相互传递
- OCiOS动效设计:UITableView 实现滚动视差效果
- iOS开发:代码通用性以及其规范 第二篇(猜想iOS中实现TableView内部设计思路(附代码),以类似的思想实现一个通用的进度条)
- 复杂UI的组织-创建者模式-uitableview思想
- 浅谈ios设计之使用表格UITableVIew设计通讯录的方法
- RecyclerView的设计思想
- UITableView性能提升和优化(第3章) 之二
- IOS - 自定义表格(UITableView)
- UITableView表头在下拉的时候表头里的内容放大
- UITableView重用机制
- UITableView 去掉背景 分割线
- Android编程思想,面向对象程序设计第一篇——设计模式6个原则
- 关于UITableView中每个section的header显示
- UITableView dequeueReusableCellWithIdentifier
- iOS去掉UITableView多余的separator
- IOS学习:基本控件(UITableView)
- UITableView cell的重用
- UITableView (4): 在TableView中移动cell和Section 从TableView中删除cell和section 添加系统默认刷新控件