gpt4 book ai didi

iphone - 如何在用户单击 UITableViewCell Accessory DetailDisclosureButton 时显示选项

转载 作者:太空狗 更新时间:2023-10-30 03:49:38 26 4
gpt4 key购买 nike

enter image description here

我在将 UITableViewCellAccessoryDe​​tailDisclosureButton 作为单元格附件的 UITableView 中显示记录。我想在用户单击详细信息披露按钮时显示这些“保存”、“发送到”和“访问”选项,但我不知道如何执行此操作。请帮助我。

最佳答案

首先,您必须实现(这是来自特定选择行的不同调用)

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath

在其中,您正在使用如下代码:

        UIMenuController *menuController = [UIMenuController sharedMenuController];
AddRouteMenuItem *menuItem = [[AddRouteMenuItem alloc] initWithTitle:@"Add to push list" action:@selector(addRouteMenuButtonPressed:)];
menuItem.indexPath = pressedIndexPath;
menuController.menuItems = [NSArray arrayWithObject:menuItem];
[menuItem release];
[menuController setTargetRect:[self.tableView rectForRowAtIndexPath:pressedIndexPath] inView:self.tableView];
[menuController setMenuVisible:YES animated:YES];

你按下了 index path = indexPath

最后一点 - 是指向附件按钮的更改指针- (void)setTargetRect:(CGRect)targetRect inView:(UIView *)targetView

关于iphone - 如何在用户单击 UITableViewCell Accessory DetailDisclosureButton 时显示选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7657818/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com