2015-10-24 72 views

回答

1

移動的兩種觀點和中心外的按鈕,它垂直

0

您應該創建的UIViewUIView2子類,並覆蓋hitTest這樣的:

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event 
{ 
    if (!self.clipsToBounds && !self.hidden && self.alpha > 0) { 
     for (UIView *subview in self.subviews.reverseObjectEnumerator) { 
      CGPoint subPoint = [subview convertPoint:point fromView:self]; 
      UIView *result = [subview hitTest:subPoint withEvent:event]; 
      if (result != nil) { 
       return result; 
      } 
     } 
    } 

    return nil; 
}