UITableView 左划删除

时间:2014-05-08 16:33:27   收藏:0   阅读:205

-(BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath

{

returnYES;

}

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

{

if (editingStyle == UITableViewCellEditingStyleDelete) {

       [tableView deleteRowsAtIndexPaths:[NSArrayarrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];

   }

}


直接可以左划出现删除

再同步删除数据源就好。


点击编辑之后的删除方式似乎成为了鸡肋。

本文出自 “哪一种调调” 博客,请务必保留此出处http://ruanstao.blog.51cto.com/8702511/1408396

UITableView 左划删除,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!