0

我多次使用此代码,但在我当前的项目中它不起作用。这是错误(第三行):“'UIGestureRecognizer'没有可见的@interface声明选择器'translationInView:'

和我的简单代码:

- (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;
    }
}
4

1 回答 1

1

您正在寻找具有 UIGestureRecognizer 作为父类的 UIPanGestureRecognizer。

- (IBAction)panLayer:(UIPanGestureRecognizer *)pan{
}
于 2013-02-24T03:58:25.953 回答