UIMenu 按钮在使用后消失
我已经像这样自定义了 UIMenuController:
UIMenuItem* note = [[[UIMenuItem alloc] initWithTitle:@"Note action:@selector(noteItemTapped:)] autorelease];
UIMenuItem* share = [[[UIMenuItem alloc] initWithTitle:@"Share" action:@selector(shareItemTapped:)] autorelease];
[[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObjects:note, share, nil]];
[[UIMenuController sharedMenuController] update];
并且在 UIWebView 中它可以工作,但有一些问题: 1)经过一些使用后,仅显示默认的“复制”按钮 2)它们不支持触摸(我的视图中添加了 UITapGestureRecognizer),但如果我触摸并拖动一点,它们就可以了。
任何人都可以为我提供一些此类定制的教程或针对问题提出一些建议吗?
I've customized UIMenuController like this:
UIMenuItem* note = [[[UIMenuItem alloc] initWithTitle:@"Note action:@selector(noteItemTapped:)] autorelease];
UIMenuItem* share = [[[UIMenuItem alloc] initWithTitle:@"Share" action:@selector(shareItemTapped:)] autorelease];
[[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObjects:note, share, nil]];
[[UIMenuController sharedMenuController] update];
and in UIWebView it work, but with some problems:
1) After some usings only default "Copy" button is shown
2) They don't on touch (I have a UITapGestureRecognizer added to my view) but if I touch and drag a little, they ok.
Can anyone provide me with some tutorials of such customizing or give some your suggestions about problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个 Stackoverflow 答案,应该可以解决您的问题:
UIMenuController 未显示
Here is a Stackoverflow Answer that should solve your problem:
UIMenuController not showing up