UITableView(二编辑插入)
来源:互联网 发布:巴尔坦星人 知乎 编辑:程序博客网 时间:2024/05/17 07:51
2.插入行
//设置编辑样式-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.section == 1) { return UITableViewCellEditingStyleDelete; //第二个编辑样式为删除 } else if (indexPath.section ==2){ return UITableViewCellEditingStyleInsert; //第三个编辑样式为添加 } return UITableViewCellEditingStyleNone; }
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ if (editingStyle == UITableViewCellEditingStyleInsert) { NSLog(@"%s,%d",__FUNCTION__,__LINE__); if (2 == indexPath.row) { //添加新生 NSMutableArray * oneGoupArray = [_allGroupArray objectAtIndex:indexPath.section]; [oneGoupArray addObject:@"云"]; //实现UI NSIndexPath * insertIndexPath = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:indexPath.section]; [tableView insertRowsAtIndexPaths:[NSArray arrayWithObjects:insertIndexPath, nil] withRowAnimation:UITableViewRowAnimationRight]; } }}
0 0
- UITableView(二编辑插入)
- UITableView(二编辑删除)
- UITableView(二编辑移动)
- UITableView基本属性二:编辑模式
- 编辑UITableView
- UITableView编辑
- UITableView编辑
- UITableView编辑
- UITableView编辑
- UITableVIew 编辑
- UITableView 编辑
- 【UITableView】UITableView 编辑
- 爬爬爬之路:UI(十) UITableView(二) UITableView编辑 UITableViewCell移动
- UITableView 添加,删除,编辑
- UITableView编辑模式
- UITableView编辑模式
- UITableView编辑模式详解
- UITableView编辑模式
- EJB+JPA演示实体类基本操作CRUD的实现
- 老学员衣锦还传智,“浪漫”约会平面小伙伴
- 老码农教你学英语
- 旅行,写作,编程
- Activity详解
- UITableView(二编辑插入)
- [转载]《AngularJS》5个实例详解Directive(指令)机制
- 用PLSQL创建oracle用户
- OJ 1.R
- POJ 2243 Knight Moves
- 中秘传媒:网络品牌营销行业领跑者
- PCIE 设备扫描的过程
- ssh框架报错和真实错误不相关
- 使用openstack架构私有云