You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

询问UIKit中长按单元格弹出的黑色选项栏组件名称

Answer

Hey there! The component you're trying to remember is almost certainly UIContextMenuInteraction (paired with UIMenu and UIMenuElement) if you're targeting iOS 13 or later.

Here's a quick breakdown to clarify:

  • This native UIKit component enables you to add a long-press triggered menu to table view cells (or any UIView, for that matter). You can set it up either by attaching the interaction directly to your cell, or using the UITableView delegate method contextMenuConfigurationForRowAt to define menu actions, nested submenus, and even preview content that appears when the user long-presses the cell.
  • If you're recalling an older implementation (pre-iOS 13), developers often combined UITableViewRowAction with custom long-press gesture recognizers to replicate similar functionality—though the native system menu experience wasn't as polished back then.

If your example image shows a sleek, rounded system-style menu with support for hierarchical actions and previews, it’s definitely the modern UIContextMenuInteraction + UIMenu combo from UIKit.

内容的提问来源于stack exchange,提问作者Fernando

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:19:15