在自定义cell里面实现跳转的方法
2015-08-19 11:00
369 查看
我做的是
collectionView 里面铺了一个 tableView ,tableView写在了自定义的cell里;
在自定义里面无法实现跳转功能, 在ViewComtroller里面签一个代理,
<UITableViewDelegate>
在引一下需要跳转页面的头文件;
在CollectionViewCell 的代理中签代理人 cell.tableView.delegate = self;
在实现跳转方法;
// 点击方法,跳转
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
TwoViewController *two = [[TwoViewController alloc] init];
[self.navigationController pushViewController:two animated:YES];
}
collectionView 里面铺了一个 tableView ,tableView写在了自定义的cell里;
在自定义里面无法实现跳转功能, 在ViewComtroller里面签一个代理,
<UITableViewDelegate>
在引一下需要跳转页面的头文件;
在CollectionViewCell 的代理中签代理人 cell.tableView.delegate = self;
在实现跳转方法;
// 点击方法,跳转
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
TwoViewController *two = [[TwoViewController alloc] init];
[self.navigationController pushViewController:two animated:YES];
}
相关文章推荐
- 人脸性别识别文献阅读笔记(2)
- 利用ng-click、ng-switch和click-class制作切换的tabl
- 【LeetCode】168. Excel Sheet Column Title
- 深入理解Javascript window对象
- Python中的集合类型知识讲解
- 指针及地址笔记
- Hadoop自动化集群部署脚本
- bfs入门题 poj 1915 knight moves
- 利用HttpURLConnection下载文件的核心代码代码
- WCF Binding实例
- 隐藏系统布局的ProgressDialog中的button
- Spring 的ClassPathXmlApplicationContext()路径读取错误
- Java整型有序数组遍历一次输出其中重复的值
- Unable to execute dex: Multiple dex files define Landroid/support/v7/appcompat/R$anim;问题解决
- servlet设置缓存时间以及文件的下载
- text-align:justify实现文本两端对齐布局,兼容IE
- 指针函数笔记小结
- 各种移动GPU压缩纹理的使用方法
- WPF 自定义图片剪切器 - 头像剪切。你懂得
- Programming in scala学习笔记(一)First step in scala