引言: 滴滴主页,UI层最下方是地图,上方有选择地址等.
摘录:这里主要引用了别人的一篇文章: iOS 仿滴滴出行界面UI
// 主要是有这样段代码
@implementation EKScrollView
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
int index = self.contentOffset.x / [[UIScreen mainScreen]bounds].size.width;
if (index < self.subviews.count) {
UIView *view = self.subviews[index];
CGPoint viewpoint = [self convertPoint:point toView:view];
if (viewpoint.y < 0) {
return nil;
}
}
return [super hitTest:point withEvent:event];
}
@end