Just like this, cells can cover MKMapView. When table scrolls down, MKMapView can be touched.
How to? Special thanks
Just like this, cells can cover MKMapView. When table scrolls down, MKMapView can be touched.
How to? Special thanks
1.add a header view for table view, 320px height with clear background color.
2.put MKMapView under UITableView.
3.override table view's hitTest:withEvent:
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
UIView *view = [super hitTest:point withEvent:event];
if (view == self.tableHeaderView) {
return nil;
}
return view;
}
Place your image in background or at least behind your tableview. Then set the size of the first row (or header if you prefer) for something big: maybe 350px. Set the backgroundColor of the tableview to [UIColor clearColor] and set the backgroundColor of your first cell to [UIColor clearColor] too. You may have to take a special care to the opaque property of your views: tableView and the cell
Here is a Swift 3 version of OpenThread's answer, but it doesn't require you to add a header to your UITableView
- just subclass it and add this:
class YourTableView: UITableView {
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let view = super.hitTest(point, with: event)
if view is YourTableView {
return nil
}
return view
}
}