【问题标题】:How to control Copy & Paste popup position of UITextField?如何控制 UITextField 的复制和粘贴弹出位置?
【发布时间】:2013-01-25 15:32:51
【问题描述】:

是否可以控制UITextFieldPaste 弹出位置,例如在UITextField 的上方或下方?

【问题讨论】:

    标签: ios objective-c cocoa-touch uitextfield


    【解决方案1】:

    是的,我相信您正在寻找的方法是setTargetRect:inView:。您可以在Apple Docs 中阅读更多相关信息。

    这是来自Apple的一些通用代码

    UIMenuController *theMenu = [UIMenuController sharedMenuController];
    CGRect selectionRect = CGRectMake (currentSelection.x, currentSelection.y, SIDE, SIDE);
    [theMenu setTargetRect:selectionRect inView:self];
    [theMenu setMenuVisible:YES animated:YES];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-21
      • 2012-07-03
      • 2010-12-20
      • 2021-06-22
      • 2020-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多