CommonTableCollectView使用例子:tableView的编辑模式

来源:互联网 发布:医疗器械 进销存软件 编辑:程序博客网 时间:2024/04/29 14:32

允许转载,但附上点击打开链接



<span style="font-family:Menlo;color:#fcfb00;"><span style="font-size: 24px;"> </span></span>[tableView addNibWithEntity:数据对象 andCellName:@"cell的文件名字" editStyle:UITableViewCellEditingStyleDelete];

加进去的代码只有一句,操作删除功能的代码,也在cell里面写,cell继承commoncell


-(void)commonTableView:(CommonTableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{    if (editingStyle == UITableViewCellEditingStyleDelete) {        [tableView removeIndexPath:indexPath withRowAnimation:UITableViewRowAnimationFade];             //xxxxxxx,这里按你的需要补上你的代码,例如删除本地数据库的缓存之类的    }}



如图:(删除模式)

 


完!下一篇讲怎么添加字母索引CommonTableview

0 0
原创粉丝点击