harmony 鸿蒙Menu Overview

  • 2025-06-12
  • 浏览 (5)

Menu Overview

A menu is a pop-up window that allows users to perform specific actions. It typically appears when users right-click, long-press, or touch an item.

When to Use

API Use Case
Menu control (Menu) Used to bind actions to specified components, such as displaying operation options when an icon is long-pressed.
Global menu independent of UI components (openMenu) Used to show options in scenarios where UI components cannot be directly accessed, for example, in event callbacks.

Constraints

  • Menus can be displayed only after the page is fully built. Setting the show property to true during page construction may result in issues with the menu’s position and shape.
  • When using openMenu, you need to provide valid TargetInfo. Otherwise, the menu won’t display correctly.
  • For details about other specifications, see Menu Control and openMenu.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙Atomic Service Full Screen Launch Component (FullScreenLaunchComponent)

harmony 鸿蒙Arc Button (ArcButton)

harmony 鸿蒙Animation Smoothing

harmony 鸿蒙Animation Overview

harmony 鸿蒙Frame Animation (ohos.animator)

harmony 鸿蒙Implementing Property Animation

harmony 鸿蒙Property Animation Overview

harmony 鸿蒙Dialog Box Overview

harmony 鸿蒙Blur Effect

0  赞