开发者

UITableView inside TableCell

开发者 https://www.devze.com 2023-02-09 11:36 出处:网络
do anyone have experience with 开发者_开发问答UITableView inside a custom UITableViewCell ? I had a try and the UITableView in the UITableViewCell looks like that can\'t respond to user inputs (i.e s

do anyone have experience with 开发者_开发问答UITableView inside a custom UITableViewCell ?

I had a try and the UITableView in the UITableViewCell looks like that can't respond to user inputs (i.e scrolling).

Before going any further I would like to know if I am wasting my time !

Does anyone have seen something like that around ? Any reference would be helpful.

Thanks


I haven't done this, but I discourage this. This could cause odd things to happen.

In a similar vein, Apple says not to use UIWebView inside of a UIScrollView. The reason is because a web view is a subclass of the scroll view. Nesting them can cause unexpected behaviors. Note that the table view is also a subclass of the scroll view. While Apple doesn't explicitly mention your case, I assume that it is the same idea.

If yo must, subclass UITableViewCell and see what happens. It's not that difficult. Make the cell implement the UITableViewDelegate protocol.


Since the parent TableView responds to the vertical swipe gesture, your child TableView is not going to ever see it. Where should the swipe gesture "go"? It has to go one place or the other, so one of the TableViews will always not behave "correctly". I do think that trying to put a TableView inside a TableViewCell and getting it to work just like a root TableView is probably a waste of time.

0

精彩评论

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