Docsv3.11.0
Back to API Reference
Class

NativeTextContextMenu

sealed
Implements:ITextContextMenu

Presents the platform's own text edit menu: the floating selection toolbar on Android and the edit menu on iOS, each drawn, styled, ordered, localized, positioned and animated by the system.

Remarks

The menu carries the standard commands the current ContextMenuCapabilities allow, and every command the user invokes is routed back through the presenter — the field that showed the menu — so the platform UI performs UniText's own cut, copy, paste and select-all rather than the system's idea of them. It anchors to a box rather than to a single point: the box the menu must keep clear of (TryGetContextMenuScreenRect) — the whole selection, or the caret's own line box for a collapsed selection — is handed to the system, which then places the menu clear of it the way it does in every other app. Only a selection with no such box anchors at the point the caller passed. The system menu exists on Android 6.0 and iOS 13 and later; iOS 16 and later present it through the edit-menu interaction that replaced the older menu controller. Elsewhere — every other platform, the Editor, and older devices — there is no system menu to present and this entity shows nothing; assign PrefabTextContextMenu for a presentation that exists everywhere.
public bool IsVisible{ get }
public void Show()
public void Hide()
protected override void OnAttach()
protected override void OnDetach()