美文网首页程序员
QQ聊天中UITableViewCell的"滑动出现多

QQ聊天中UITableViewCell的"滑动出现多

作者: iOS之家 | 来源:发表于2016-06-08 11:36 被阅读81次

主要方法:

- (NSArray*)tableView:(UITableView*)tableView editActionsForRowAtIndexPath:(NSIndexPath*)indexPath;

主要代码:

- (NSArray*)tableView:(UITableView*)tableView editActionsForRowAtIndexPath:(NSIndexPath*)indexPath {

 UITableViewRowAction*deleteRowAction = [UITableViewRowActionrowActionWithStyle:UITableViewRowActionStyleDestructivetitle:@"删除"handler:^(UITableViewRowAction*action,NSIndexPath*indexPath) {

//刷新[self.tableViewreloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];

}];

UITableViewRowAction*topRowAction = [UITableViewRowActionrowActionWithStyle:UITableViewRowActionStyleDefaulttitle:@"标为未读"handler:^(UITableViewRowAction*action,NSIndexPath*indexPath) {

[self.tableViewreloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];

}];

topRowAction.backgroundColor= [UIColorblueColor];

UITableViewRowAction*moreRowAction = [UITableViewRowActionrowActionWithStyle:UITableViewRowActionStyleNormaltitle:@"置顶"handler:^(UITableViewRowAction*action,NSIndexPath*indexPath) {

[self.tableViewreloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];

}];

return@[deleteRowAction,topRowAction,moreRowAction];

}

相关文章

网友评论

    本文标题:QQ聊天中UITableViewCell的"滑动出现多

    本文链接:https://www.haomeiwen.com/subject/jqqjdttx.html