2013-02-23 20 views
0

我多次使用此代碼,但在我目前的項目中,它不工作。以下是錯誤(第三行):您正在尋找具有UIPanGestureRecognizertranslationInView無法正常工作

- (IBAction)panLayer:(UIGestureRecognizer *)pan{ 
if (pan.state == UIGestureRecognizerStateChanged) { 
    CGPoint point = [pan translationInView:self.view]; 
    CGRect frame = self.settingsView.frame; 
    frame.origin.y = self.layerPosition + point.y; 
    if (frame.origin.y < 0) { 
     frame.origin.y = 0; 
    } 
} 

回答

1

: 「爲‘UIGestureRecognizer’不可見@interface聲明選擇‘translationInView:’

和我簡單的代碼UIGestureRecognizer作爲父類。

- (IBAction)panLayer:(UIPanGestureRecognizer *)pan{ 
} 
+0

謝謝!那是​​錯誤:) – BalestraPatrick 2013-02-24 07:59:17