TableViewCell实现长按复制功能
来源:互联网 发布:pony粉饼知乎 编辑:程序博客网 时间:2024/06/08 04:55
#pragma mark - 长按复制cell 相关代理方法// 允许长按菜单- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.section == 4 && indexPath.row == 1) { return YES; }else{ return NO; }}// 点击指定的cell 出现Menu菜单- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender{ if (indexPath.section == 4 && indexPath.row == 1) { if (action == @selector(copy:)) { return YES; } } return NO;}// 执行复制操作- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender{ if (indexPath.section == 4 && indexPath.row == 1) { if (action == @selector(copy:)) { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard]; // 粘贴板 [pasteBoard setString:cell.detailTextLabel.text]; } }}
阅读全文
0 0
- TableViewCell实现长按复制功能
- 长按tableViewCell弹出复制、黏贴菜单
- 长按tableViewCell弹出复制、黏贴菜单
- 长按TextView实现复制功能
- ios中tableViewCell的长按实现
- Android textview 实现长按自由选择复制功能
- 长按删除tableviewCell
- tableviewcell长按删除行
- label的长按复制的功能
- Android开发TextView实现长按复制文本功能的方法
- Android开发TextView实现长按复制文本功能的方法
- Android开发TextView实现长按复制文本功能的方法
- TextView长按复制实现方法小结
- TextView长按复制实现方法小结
- TextView长按复制实现方法小结
- TextView长按复制实现方法
- TextView长按复制实现方法小结
- android textView实现长按复制
- C语言指针1
- Hybrid APP 混合开发模式的选择之路(五:原生和H5的交互原理)
- 物联网,又一波浪潮
- 八皇后问题
- 微信小程序错误:WAService.js 3 navigateTo fail url
- TableViewCell实现长按复制功能
- QSqlRecord 类
- Linux档案与目录管理命令
- GYP
- DELAUNAY三角网算法(生长算法、逐点插入算法、分治算法)
- tomcat部署方式
- Android安全模式
- Zookeeper系列—配置文件详解
- shell