ios - 显示 UIMenuController 取消选择 UITableViewCell

标签 ios objective-c uitableview uimenucontroller

我在显示 UIMenuController 的表格 View 单元格上实现了长按手势识别器。但是当菜单显示时,相应的表格 View 单元格取消选择。在显示菜单之前,我根据需要调用 [self becomeFirstResponder]。我认为这个调用会取消选择单元格,但是如何让它在 UIMenuController 可见时保持选中状态?

最佳答案

根据 the documentation,在您的 UITableViewDelegate 中,覆盖 tableView:willDeselectRowAtIndexPath: 并在您不希望取消选择行时返回 nil .

关于ios - 显示 UIMenuController 取消选择 UITableViewCell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14461644/

相关文章:

iOS 本地化搞乱了 UI

iPhone:导航栏 "back"按钮可点击 = 否?

ios - 手动显示当前位置蓝点MKMapView ios

iphone - iOS 模拟器 : Application can't terminate correcly

html - Objective-C 认证

ios - 从 Storyboard 扩展 ViewController

ios - 如何在 UICollectionView 上动态实现 Sections?

objective-c - Objective C NSTextField 在发送命令时保持框中文本突出显示

ios - 刷新后 UIRefreshControl 未隐藏。 iOS

ios - 将数据从 AWS DynamoDB 表加载到 iOS 上的 UITableView