UIMenuController 如何显示选择
我如何使用如下所示的选择来实现 UIMenuController?我有一个 UIScrollview,其中在 UIView (CGPDF...) 中加载了 PDF。我让 MenuController 在没有选择的情况下工作,但不知道如何在屏幕上获得选择。现在选择什么对我来说并不重要。我只想显示视觉选择。
下面是我用于 UIMenuController 的代码。
UITouch *touch = [touches anyObject];
CGPoint tapPoint = [touch locationInView:self];
NSLog(@"\nPosition of Touch\nHeight: %f\nWidth: %f", tapPoint.y, tapPoint.x);
CGRect drawRect = CGRectMake(tapPoint.x, tapPoint.y, 20, 20);
UIMenuController *menu = [UIMenuController sharedMenuController];
[menu setTargetRect:drawRect inView:self];
[menu setMenuVisible:YES animated:YES];
how can i implement the UIMenuController with a selection shown below? I have a UIScrollview with a PDF loaded in it in a UIView (CGPDF...). I get the MenuController working without a selection but dunno how I can get the selection on the screen. It does not matter for me what is selected for now. I just want to have the visual selection shown.
Below is the code I use for the UIMenuController.
UITouch *touch = [touches anyObject];
CGPoint tapPoint = [touch locationInView:self];
NSLog(@"\nPosition of Touch\nHeight: %f\nWidth: %f", tapPoint.y, tapPoint.x);
CGRect drawRect = CGRectMake(tapPoint.x, tapPoint.y, 20, 20);
UIMenuController *menu = [UIMenuController sharedMenuController];
[menu setTargetRect:drawRect inView:self];
[menu setMenuVisible:YES animated:YES];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论