Touch and hold in TableViewCell to show (tooltip) popover is it possible in iPhone?
According to image could you please advise me which function use to develop this feature? i'm not sure, is开发者_如何学运维 it implement from UIPopover? any idea, thank you.
source from Music.app iOS 5 beta 2
You can use a UIGestureRecognizer. Specifically, what you are looking for is a UILongPressGestureRecognizer
You should instantiate one and attach it to the view you would like to track the gesture on:
UILongPressGestureRecognizer* gestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
[view addGestureRecognizer:gestureRecognizer];
Then, in your handler method you would do the rest:
- (void)handleGesture:(UILongGestureRecognizer *)recognizer {
if (recognizer.state == UIGestureRecognizerStateBegan) {
} else if (recognizer.state == UIGestureRecognizerStateEnded) {
}
}
EDIT: for the popover implementation, have a look at WEPopover
精彩评论