开发者

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

Touch and hold in TableViewCell to show (tooltip) popover is it possible in iPhone?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜