开发者

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

开发者 https://www.devze.com 2023-03-18 21:22 出处:网络
According to image could you please advise me which function use to develop this feature? i\'m not sure, is开发者_如何学运维 it implement from UIPopover?

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

精彩评论

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