How to get UIMenuController work for a custom view?

前端 未结 9 1213
旧时难觅i
旧时难觅i 2020-12-02 10:56

I\'m trying to get the following code work:

UIMenuController * menu = [UIMenuController sharedMenuController];
[menu setTargetRect: CGRectMake(100, 100, 100,         


        
9条回答
  •  攒了一身酷
    2020-12-02 11:31

    Don't you have to add the UIMenuController* menu to the main or subview, E.G. self.view? I think it's something like [self.view addSubView:menu.view]; Or am I missing the point of your question. You might also want to set the frame of the menu's view.

提交回复
热议问题