通过Cell的UIButton获取UITableViewCell的行数
来源:互联网 发布:网络信息安全自查报告 编辑:程序博客网 时间:2024/06/07 12:03
在UIButton的点击事件中做处理,以下是两种方法:
方法1:
UITableViewCell * cell = [(UITableViewCell*)[sender superview] superview]; NSIndexPath * indexPath = [self.table indexPathForCell:cell]; DLog(@"cell's row %d",indexPath.row);
方法2:
UIButton * btn = (UIButton*)sender; CGRect buttonRect = btn.frame; for (UITableViewCell *cell in [self.table visibleCells]) { if (CGRectIntersectsRect(buttonRect, cell.frame)) { //TODO } }
0 0
- 通过cell的UIButton获取UITableViewCell的行数
- 通过Cell的UIButton获取UITableViewCell的行数
- 通过cell的UIButton获取UITableViewCell的行数及Cell数据
- iOS 点击UITableViewCell上的按钮获取当前cell和行数
- iOS中如何通过点击UITableViewCell中的Button来获取当前Cell的indexPath
- 获取UITableViewCell中的按钮所在的cell的indexPath.row
- iOS 点击UITableViewCell上的控件获取对应的cell
- 自定义UITableViewCell中获取按钮所在Cell的indexPath
- iOS 自定义UITableViewCell上添加UIButton按钮实现选中的是哪个按钮对应的cell,用代理实现。
- UITableViewCell的操作(增加cell,删除cell,插入cell)
- (0066)iOS开发之UITableViewCell上子控件通过superView找对应的cell的探究
- UITableViewCell自定义accessoryView,通过tag避免因为Cell重用导致的button状态重复
- iOS开发---通过坐标位置获取对应的UITableViewCell
- UITableViewCell注册Cell并重用的方法
- 22.UITableViewCell根据Cell的内容自适应
- Cell简介和UITableViewCell的contentView
- UITableViewCell上的cell与content…
- 自定义带有cell间距的UITableViewCell
- Unity多屏研究
- 【LeetCode】递归和非递归的区别
- 网站被黑,打开网页自动下载文件
- c++队列
- adt新建项目出现appcompat_v7依赖的解决办法
- 通过Cell的UIButton获取UITableViewCell的行数
- 用yum查询想安装的软件/安装路径
- c3p0详细配置
- Apache Spark技术实战之6 -- spark-submit常见问题及其解决
- oc笔记<6>description方法与NSLog
- WinSocket简单编程实验
- Linux shell字符串截取与拼接
- 自省
- 杨辉三角