Onato
Onato

Reputation: 10221

Recognize Gestures behind a Transparent UITableView

In the view hierarchy, seen in the diagram below, I would like to be able to drag the portion of the map that can be seen through the clear UITableView (2).

--------------------------------
|1. MKMapView                  |
|   -------------------------------
|   |2. Clear UITableView      |  |
|   |   Content Offset         |  |
|   |                          |  |
|   |                          |  |
|   -------------------------------
|   |Cell                         |
|   -------------------------------
|   |Cell                         |
    -------------------------------

The MKMapView is behind a UITableView. The UITableView that has a positive content offset and a clear background.

At the moment the UITableView is taking the gesture and the map can not be panned. How can I tell the table view that is should only scroll when the cells are panned.

Upvotes: 4

Views: 131

Answers (1)

Wain
Wain

Reputation: 119031

If you can, change the frame of the table view so it just isn't placed over the map.

If you can't, subclass the table view and implement hitTest: to decide if the user interaction should be handled by the table view or not.

Upvotes: 3

Related Questions