开发者

UITableView as cell on another UITableView cancel the scroll

I have a UITableView that their cells are UITableViews (the root tableView is rotated to work in landscape, similar 开发者_JAVA百科to the CoverFlow).

The tableview cells show fine, but I can't scroll it, I think because the root tableView capture all the touch events.

The horizontal tableview can show dozens of cell tableviews, so I need to preserve the ability to swipe left/right the root tableview but scroll down/up the cells tableviews.


Is this similar to what the Pulse app does? If the table view doesn't automatically handle this for you, you may have to subclass UITableView and implement your own gesture responders. Shouldn't be too difficult though—just handle flicks and drags. You could also try enabling/disabling user interaction on one of the table views based on user scroll/flick direction.


I finally put a UIScrollView instead of a UITableView. Everything work fine now:

self.floatingColumns = [[UIScrollView alloc] init];
self.floatingColumns.pagingEnabled = YES;
[self.floatingColumns setShowsHorizontalScrollIndicator:NO];
[self.floatingColumns setDelegate:self];


If you are looking for something like Pulse, this tutorial might help: http://iosstuff.wordpress.com/2011/06/29/creating-pulse-style-scrolling-horizontally-scrolling-uitableview-as-a-subview-of-uitableviewcell/

It shows how to add horizontally scrolling tableviews to tableview cells. Pretty cool!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜