您的位置:首页 > 产品设计 > UI/UE

UITableView 滑动删除

2012-10-31 09:32 148 查看
//先要设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];
}
*/
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: