UIMenu Controller
Roman Babenko edited this page Jul 1, 2020
·
2 revisions
The native iOS menu interface for the Cut, Copy, Paste, Select, Select All, and Delete commands.
We have ISN_UIMenuController
in UIKit
for accessing this functionality. You can access it through SharedMenuController
instance.
using SA.iOS.UIKit;
UIMenuController
shared controller that referred to as the editing menu. You can provide your own menu items via the MenuItems
property of ISN_UIMenuController
.
var menuItems = new List<string> { "Button 1", "Button 2", "Button 3" };
ISN_UIMenuController.SharedMenuController.MenuItems = menuItems;
ShowMenuFromPosition
method. UIMenuController positions it relative to a target position that you set in this method by setting float xPos
and float yPos
.
var xPos = target.x;
var yPos = target.y;
ISN_UIMenuController.SharedMenuController.ShowMenuFromPosition(xPos, yPos, result =>
{
if (menuItems.Count > result.ChosenIndex)
{
var chosenItem = menuItems[result.ChosenIndex];
Debug.Log("User picked item " + chosenItem + " at position " + result.ChosenIndex);
}
});
menuItem
it return ChosenIndex
of this item.
The menu appears above the target position rectangle or if there is not enough space for it, below it. The menu’s pointer is placed at the center of the top or bottom of the target position, as appropriate.
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Getting Started
- Authentication
- Game Center UI
- Leaderboards
- Default Leaderboard
- Achievements
- Saving A Game
- Access Point
- iTunes Connect Setup
- StoreKit Initialization
- Purchase flow
- Receipt Validation
- Store Review Controller
- Storefront API
- Subscription Offers