cell中有一个按钮,点击按钮删除本行cell,并有系统自带的由右向左的效果(效果有多种)
2015-12-30 16:55
113 查看
1.获取相对应的cell
UITableViewCell *cell = [self.tableViewviewWithTag:tage+100];
2.获取cell的indexPath
NSIndexPath * indexPath = [self.tableViewindexPathForCell:cell];
3.先删除数据,再删除本行cell
[dateArrayremoveObjectAtIndex:tage];
[self.tableViewdeleteRowsAtIndexPaths:[NSArrayarrayWithObject:indexPath]withRowAnimation:UITableViewRowAnimationLeft];
[self.tableViewreloadData];
UITableViewCell *cell = [self.tableViewviewWithTag:tage+100];
2.获取cell的indexPath
NSIndexPath * indexPath = [self.tableViewindexPathForCell:cell];
3.先删除数据,再删除本行cell
[dateArrayremoveObjectAtIndex:tage];
[self.tableViewdeleteRowsAtIndexPaths:[NSArrayarrayWithObject:indexPath]withRowAnimation:UITableViewRowAnimationLeft];
[self.tableViewreloadData];
相关文章推荐
- spring 与 mybatis整合,mybatis注解不起作用
- AIDL中使用java类
- 高德地图基本使用
- [转载]通天塔导游:各种编程语言的优缺点
- Junit原理详解四
- 交互式设计--如何让你的界面简约
- 树莓派输出电流设置
- HTTPS、SPDY、HTTP/2 对比
- Junit原理详解三
- 安卓中的音乐播放
- Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.8.1:jar (module-javadocs) on
- 使用 adb shell 抓取 Android 性能数据
- 文件上传 汇总
- 二叉树的顺序存储
- Hadoop的文件系统
- jQuery中的事件
- 运维安全系列基础服务之 FTP 服务(系列一)
- 2015年英语学习——12月
- nGrinder学习笔记 — 简介和环境搭建
- 第九章网络设备文件管理