Handle touch events when UITableView placed over UITableView
I have a SplitViewController with a UITableView on the left.
I am trying to place a small UITableView over a part of the screen, but touches seem to be handled strangely when the small UITableView is placed over the left UITableView.
I am placing the UITableView over the SplitView like this:
MenuViewController *menu = [[MenuViewController alloc] initWithNibName:nil bundle:nil];
[self.splitViewController.view addSubview:menu.view];
Some touches 开发者_开发问答are registered by menu.view, while sometimes I am able to scroll the underlying view "through" menu.view.
So my question is: what decides which view reacts to touch events?
So I found that the solution was, that I needed to set clipsToBounds=YES on the views contained in menu.view.
Not sure I fully understand the solution, but it works.
精彩评论