UITableViewController相关

来源:互联网 发布:linux 是否安装lvm 编辑:程序博客网 时间:2024/06/05 02:49

\

//tableView出现的时候,清除选中状态

clearsSelectionOnViewWillAppear

//自定义下拉(刷新)时候出现的控件

refreshControl

//为cell添加功能性按钮(iOS>=8),即滑动cell出现按钮

+ (instancetype)rowActionWithStyle:(UITableViewRowActionStyle)style title:(NSString *)title handler:(void (^)(UITableViewRowAction *action, NSIndexPath *indexPath))handler


#UITableView相关

循序:

numberOfSectionsInTableView-》

heightForHeaderInSection-》

numberOfRowsInSection-》

UITableViewCell-》

heightForRowAtIndexPath->

willDisplayCell


UITableViewCell

//cell将要显示出来

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;

//头视图将要显示出来

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)sectionNS_AVAILABLE_IOS(6_0);

//尾部视图将要显示出来

- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)sectionNS_AVAILABLE_IOS(6_0);

// Cell高亮的回调,一般式在选择的时候才高亮
- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(6_0);
//自定义 table views 默认的高亮或选择行为,实现两个 delegate 方法

- (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPathNS_AVAILABLE_IOS(6_0);

- (void)tableView:(UITableView *)tableView didUnhighlightRowAtIndexPath:(NSIndexPath *)indexPathNS_AVAILABLE_IOS(6_0);


//选择完成,刚抬起手指

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath;

//已经选择完成

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

//将要取消选中时候执行

- (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPathNS_AVAILABLE_IOS(3_0);

//已经取消选中

- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPathNS_AVAILABLE_IOS(3_0);



(1)- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 

(2)- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath*)indexPath 

(3)- (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath*)indexPath 

在功能性按钮显示出来之前会调用(2)方法,给我们处理问题的时间。
其实上述方法的调用顺序就是 (2)--->(1)----->(3)


其余:http://www.360doc.com/content/14/0925/09/2735774_412182927.shtml


0 0
原创粉丝点击