答案 0 :(得分:6)
那是UIMenuController
。我不善于迅速。对于 Swift ,请检查this链接。 目标C 代码如下:
- (void)showMenu
{
UIMenuController *menu = [UIMenuController sharedMenuController];
menu.menuItems = @[
[[UIMenuItem alloc] initWithTitle:@"Title1" action:@selector(MyAction1)],
[[UIMenuItem alloc] initWithTitle:@"Title2" action:@selector(MyAction2)],
[[UIMenuItem alloc] initWithTitle:@"Title3" action:@selector(MyAction)]];
[menu setTargetRect:self.bounds inView:self];
[menu setMenuVisible:YES animated:YES];
}