I would like to know how to implement this "context menu" with action buttons like the one that appears on whatsapp and other apps when you click message.
Thank you very much.
If you want to enable the taskbar context menu, select the Not configured or Disabled option in the pop-up window. To disable the taskbar context menu, select the Enabled option. Click Apply, click OK, and then restart your device to save these changes.
Right-click the newly created key, select the New menu and select the Key option. Name the key InprocServer32 and press Enter. Double-click the newly created key and set its value to blank to enable the classic context menu on Windows 11. Click the OK button.
In Microsoft Windows, pressing the Application key or Shift+F10 opens a context menu for the region that has focus.
That is UIMenuController
. I am not good with swift. For Swift please check this link. Objective C code is as follows:
- (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];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With