为UITableViewCell增加按钮及处理按钮事件的方法
来源:互联网 发布:淘宝网九块九包邮女装 编辑:程序博客网 时间:2024/06/11 09:19
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath{ UIImage *image = [UIImage imageNamed:@"test.png"]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; CGRect frame = CGRectMake(0.0, 0.0, image.size.width, image.size.height); button.frame = frame; [button addTarget:self action:@selector(accessoryViewButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; [button setBackgroundImage:image forState:UIControlStateNormal]; cell.accessoryView = button;}
根据按钮的位置获得行数:
- (void)accessoryViewButtonClicked:(id)sender{ CGPoint hitPoint = [sender convertPoint:CGPointZero toView:self.tableView]; NSIndexPath *hitIndex = [self.tableView indexPathForRowAtPoint:hitPoint]; //...}
- 为UITableViewCell增加按钮及处理按钮事件的方法
- UITableViewCell上的按钮点击事件处理
- UITableViewCell上的按钮点击事件处理
- UITableViewCell上的按钮点击事件处理
- 自定义UITableViewCell 上的多个按钮点击事件处理
- 自定义UITableViewCell 上的多个按钮点击事件处理
- 自定义UITableViewCell 上的多个按钮点击事件处理
- 自定义UITableViewCell 上的多个按钮点击事件处理
- 自定义UITableViewCell 上的多个按钮点击事件处理
- IOS--UITableViewCell上的按钮点击事件处理
- 自定义UITableViewCell 上的多个按钮点击事件处理
- 自定义UITableViewCell上的按钮点击事件处理
- 自定义UITableViewCell 上的多个按钮点击事件处理
- 自定义UITableViewCell 上按钮点击事件处理
- IOS中使用UITableViewCell的按钮事件
- iOS开发-UI控件:自定义UITableViewCell 上的多个按钮点击事件处理
- 动态的表格按钮及按钮事件
- 为IE增加按钮
- ibatis的一些优点
- 第三章——分组密码
- GDB远程调试
- Android JNI 头文件的生成
- ORACLE数据库NLS_CHARACTERSET和NLS_NCHAR_CHARACTERSET区别
- 为UITableViewCell增加按钮及处理按钮事件的方法
- 红尘陌上,为谁一抹忧伤:QQ伤感日志
- Hibernate联合主键下,主键生成策略
- C2504 base class undefined
- VS2010测试功能之旅:编码的UI测试(3)-操作对象的识别原理
- ZOJ_1115_Digital Roots
- interview street Priceing
- java-jquery(60秒发送短信验证码)源代码
- 创建纯文本、HTML格式的邮件