UITableView 滑动删除
生活随笔
收集整理的這篇文章主要介紹了
UITableView 滑动删除
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
//先要設Cell可編輯
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{NSLog(@"xxxxfffwefw");return YES;
}//修改編輯按鈕文字
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{return @"刪除";
}- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{/*if(indexPath.row ==0){[tableView setEditing:YES animated:YES]; //這個是整體出現}*/return UITableViewCellEditingStyleDelete;
}//進入編輯模式,按下出現的編輯按鈕后
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{NSLog(@"touchIIddddd");/*if(indexPath ==0){[tableView setEditing:NO animated:YES];}*/
}
總結
以上是生活随笔為你收集整理的UITableView 滑动删除的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 性能测试知多少--系统计数器与硬件分析
- 下一篇: 安装 m2eclipse 插件