简体   繁体   English

如何在iOS Swift 3中通过交互处理UICollectionViewCell中的UITableView?

[英]How to handle UITableView in UICollectionViewCell with interaction in iOS Swift 3?

I have project with structure like: 我有类似结构的项目:
- scroll view - 滚动视图
-- view - 查看
--- collection view --- 集合视图
---- collection view cell ---- 集合视图单元格
----- table view ----- 表格视图
------ table view cell ------ 表格视图单元格

This structure is necessary for this project. 该结构对于该项目是必需的。
Every things works correctly like scroll view, collection view and table view but there is interaction just with index 0 in collection view. 一切都可以正常工作,例如滚动视图,集合视图和表视图,但是集合视图中的索引0只是存在交互作用
In other words didSelectRowAt method just call in index 0 . 换句话说, didSelectRowAt方法只调用索引0

And i have uploaded my project on GitHub : 我已经在GitHub上上传了我的项目:

https://github.com/reza-khalafi/ScrollCollectionTable https://github.com/reza-khalafi/ScrollCollectionTable

Please help me to fix this problem. 请帮助我解决此问题。
Thank you 谢谢

To fix the offset try using an auto resizable cell for UITableView 要解决偏移量,请尝试对UITableView使用自动调整大小的单元格

so in setTableViewDataSourceDelegate method just call 因此在setTableViewDataSourceDelegate方法中只需调用

tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 300

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM