如何使用选项(共享、完成、删除)按钮设置 Tableview Cell Movable?这是行动?
How to set Tableview Cell Movable with option (Share,Done,Delete) Button ? and it's Action ?
I Want Set Movable Tableview Cell with Button Action.And how can i manage button action.
How Can i implement this stuff.
Here i have Attached image i want like this Image.
提前致谢
您可以在不使用任何第三方控件的情况下使用默认 UITableView
的 UITableViewRowAction
..
下面是代码片段...
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@" Edit " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
// [self callBlockUser];
}];
editAction.backgroundColor = [UIColor lightGrayColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
// [self callBlockUser];
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}
I Want Set Movable Tableview Cell with Button Action.And how can i manage button action.
How Can i implement this stuff.
Here i have Attached image i want like this Image.
提前致谢
您可以在不使用任何第三方控件的情况下使用默认 UITableView
的 UITableViewRowAction
..
下面是代码片段...
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@" Edit " handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
// [self callBlockUser];
}];
editAction.backgroundColor = [UIColor lightGrayColor];
UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){
// maybe show an action sheet with more options
// [self callBlockUser];
}];
deleteAction.backgroundColor = [UIColor redColor];
return @[deleteAction,editAction];
}