我有一个 uicollectionView
放置在 uitaiteViewCell
中。收集视图的滚动方向设置为水平。但是,当我向左滑动或向右滑动以尝试滚动时,它不起作用。相反,桌子视图单元格仅按下。看来表视图正在吞噬手势,而不允许收集视图进行注册。
我该如何制作它,以便收集视图可以用水平滑动向左和向右滚动,同时仍然允许父表视图垂直滚动?
我经过如此问题 链接的博客文章我遇到的问题。一时兴起,我还试图在我的表查看单元格的 awakefromnib()
基于中.com/forums/thread/675236“ rel =“ nofollow noreferrer”>这个问题,但似乎没有做任何事情。
I have a UICollectionView
placed inside a UITableViewCell
. The collection view has its scroll direction set to horizontal. However, when I swipe left or right on it to try and scroll, it doesn't work. Instead the table view cell is just pressed. It seems like the table view is eating up the gesture and not allowing the collection view to register it.
How can I make it so the collection view can scroll left and right with horizontal swipes, while still allowing the parent table view to scroll vertically?
I went through this SO question and its accepted answer's linked blog post, but it did not seem to address the issue I am having. On a whim, I also tried throwing sendSubviewToBack(self.contentView)
in my table view cell's awakeFromNib()
based on this question, but it didn't seem to do anything.
发布评论
评论(2)
Difficult to know without seeing your project...
Here, though, is about as basic of a setup as possible.
Source for Storyboard:
Classes:
Result:
Difficult to know without seeing your project...
Here, though, is about as basic of a setup as possible.
Source for Storyboard:
Classes:
Result:
现在,您可以在带有可组合布局的UICollectionView中使用正义滚动,以具有垂直和水平滚动的集合视图。
You can now use orthonogal scrolling in a UICollectionView with Composable layout to have a collection view that scrolls vertically and horizontally.