新手求教ios的关于button的问题,真心求解决

2025-05-10 20:50:37
推荐回答(1个)
回答1:

点击后右边会出现删除按钮
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath

{

return YES;

}
自定义删除按钮

- (NSString *)tableView:(UITableView *)tableView

titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath

{

NSString * a = @"删除";

return a;

}
删除按钮的回调函数
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

{

w