UITableView里面的UITableView处理触动. [英] UITableView inside UICollectionView handling touches.

查看:100
本文介绍了UITableView里面的UITableView处理触动.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

集合视图由一行水平排列的单元格组成,该单元格的大小与集合视图的边界大小相同,单个单元格覆盖整个屏幕.

Collection view consists of a single row, of horizontally aligned cells, which size is the same size as the collection view's bounds, single cell fills entire screen.

问题在于收集视图似乎正在拦截所有平底锅.如何将它们转发到表格,以便也可以垂直滚动表格.

The problem is that the collection view seems to be intercepting all of the pans. How can I forward them to the table so I can also scroll the table vertically.

我希望将垂直平移传递到单元格内的表格中,以便它可以上下滚动.我希望将水平平移传递到集合视图,以便它可以水平滚动.

I want vertical pan to be delivered to the table inside the cell, so it can scroll up and down. I want horizontal pan to be delivered to the collection view, so it can scroll horizontally.

有什么想法吗?谢谢.

推荐答案

对于使用StoryBoard的CollectionView中的UITableView,请按照以下步骤操作:

For UITableView inside CollectionView using storyBoard, please follow these steps:

-将CollectionView拖动到UIViewController,将数据源拖动到UIViewController(不要拖动委托).在ViewController.m中添加数据源方法

-Drag CollectionView to UIViewController, drag datasource to UIViewController(don't drag delegate). Add datasource methods inside ViewController.m

-创建Cell:CollectionViewCell类.在StoryBoard到Cell类中为Cell选择类,指定重用ID.

-Create Cell:CollectionViewCell class. choose class for Cell in storyBoard to Cell class,specify reuse ID.

-将tableView拖动到collectionCell正方形内.委托,数据源也拖到CollecionCell Square.添加tableView数据源,在Cell.m中进行委派

-Drag tableView inside collectionCell square. delegate, datasource drag to CollecionCell Square too. Add tableView datasource, delegate inside Cell.m

-在其中实现tableViewDidSelect时创建CellDelegate.将此委托转移到UIViewController以执行其他操作

-Create CellDelegate when implement tableViewDidSelect inside it. Transfer this delegate to UIViewController to perform other action

示例代码: https://github.com/lequysang/github_zip/blob /master/TableViewInCollection.zip

这篇关于UITableView里面的UITableView处理触动.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆