1

这是我的代码,但不工作


`- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
    longPress.minimumPressDuration = 2;

[self.webview addGestureRecognizer:longPress];
[longPress release];

}

  • (void)longPress:(UILongPressGestureRecognizer*)gesture { if ( gesture.state == UIGestureRecognizerStateEnded ) { NSLog(@"Long Press");

    //do something

} }`

4

0 回答 0