-1
사용자 정의보기에서 'canBecomeFirstResponder'가 YES 을 반환하도록 설정했으며 '- (BOOL) canPerformAction : (SEL) action withSender :UIMenuController는 iOS 4에는 표시되지 않지만 iOS 5에서는 작동합니다.
[self becomeFirstResponder];
UIMenuController *theMenu = [UIMenuController sharedMenuController];
if (theMenu.menuItems==nil)
{
UIMenuItem* item = [[UIMenuItem alloc] initWithTitle:@"Open" action:@selector(openAction:)];
NSArray* array = [NSArray arrayWithObject:item];
theMenu.menuItems = array;
[item release];
}
CGRect rect;
rect = CGRectMake(self.frame.size.width*0.5, self.frame.size.height*0.5, 0, 0);
[theMenu setTargetRect:rect inView:self];
theMenu.arrowDirection = UIMenuControllerArrowDown;
[theMenu setMenuVisible:YES animated:YES];
문제는이에서 iOS 5 에서 잘 작동하지만 아이폰 OS 4.3에 아무것도 표시되지 않는다는 것입니다 : 보낸 사람 '
나는 팝업 메뉴를 표시하려면 다음 코드를 사용합니다. 예상대로
그러나 BOTH iOSes의 'UIMenuControllerWillShowMenuNotification' 하고 'UIMenuControllerDidShowMenuNotification'알림 를 수신.
누구든지 올바른 방향으로 나를 도울 수 있습니까? 미리 감사드립니다.
http://stackoverflow.com/questions/2487844/simple-way-to-show-the-copy-popup-on-uitableviewcells-like-the-address-book-ap –