
本文共 4744 字,大约阅读时间需要 15 分钟。
UITableViewRowAction���������������UITableView������������������������
���iOS������������UITableView������������������������������������������������������������������������������iOS 8���������������������������������������������API������������������������������������������UITableViewRowAction������������������������������������������UITableViewRowAction���������������������������UITableView���������������������������������forcing������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������ UITableViewRowAction ������������������������������������������������
1. ���������������������������editActionForRowAtIndexPath ������
���iOS 8���������������������UITableView ��������������������������������������� - tableView:editActionsForRowAtIndexPath:
���������������������������������������������������������������������������������������������������������UITableViewRowAction������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
2. ������������������������������������
UITableViewRowAction ������������������������������
UITableViewRowActionStyleDestructive
������������������������������������������������������������������UITableViewRowActionStyleNormal
���������������������������UITableViewRowActionStyleDefault
���������������������������������
������������������������������������������������������������UITableViewRowAction���������������������������������������������������������������������������������������������������������
UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"������" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { // ������������������ NSLog(@"���������������");}];deleteRowAction.backgroundColor = [UIColor redColor];deleteRowAction.backgroundEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyle Dark];
3. ������������������������
���editActionForRowAtIndexPath������������������������������������������������indexPath.row���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������
Duty���� s��rie���- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *editActions = [NSArray new]; UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"������" handler:^{ NSLog(@"������������������������"); }]; UITableViewRowAction *editAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"������" handler:^{ NSLog(@"������������������������"); }]; UITableViewRowAction *shareAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title=@"������" handler:^{ NSLog(@"������������������������"); }]; editActions = [deleteAction, editAction, shareAction]; if (indexPath.row == 0) { // ������������������ // ������������������������ } return editActions;}
������������������������������������������������������������UITableView���������������������������������������������������������
���������������������iOS���������������������������������������������������������������������������������������������������������������������������������
4. ������������
���������UITableViewRowAction������������������������������
������������������editActions���������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������editActions������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������
title
���������������������������������
������
������UITableViewRowAction���������������������������TableView������������������������������������������������������������������������������������������������������������������������editActionsForRowAtIndexPath���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
