如何在UITableView后面添加MKMapKit?就像svpply一样 [英] How to add a MKMapKit behind UITableView? just like svpply does
本文介绍了如何在UITableView后面添加MKMapKit?就像svpply一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
就像这样,细胞可以覆盖的MKMapView。当桌子向下滚动时,可以触摸MKMapView。
Just like this, cells can cover MKMapView. When table scrolls down, MKMapView can be touched.
如何?特别感谢
推荐答案
1.添加表格视图的标题视图,320px高度,背景颜色清晰。
1.add a header view for table view, 320px height with clear background color.
2.在UITableView下输出MKMapView。
2.put MKMapView under UITableView.
3.override table view的hitTest:withEvent:
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;
}
这篇关于如何在UITableView后面添加MKMapKit?就像svpply一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文