如何在用户单击UITableViewCellAccessoryDe​​tailDisclosureButton时显示选项 [英] how to show options when a user clicks on UITableViewCellAccessoryDetailDisclosureButton

查看:62
本文介绍了如何在用户单击UITableViewCellAccessoryDe​​tailDisclosureButton时显示选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am showing records in a UITableView having UITableViewCellAccessoryDetailDisclosureButton as the cell accessory. I want to display these "Save","Send to" and "Visit" options when user click on detail disclosure button, but i have no idea how to do this. Please help me.

推荐答案

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

At first, you have to implement (this is different call from particular select row)

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

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

inside it, you're using some code like this:

        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];

您按下索引路径= indexPath

You pressed index path = indexPath

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

last point - is a change pointer to accessory button - (void)setTargetRect:(CGRect)targetRect inView:(UIView *)targetView

这篇关于如何在用户单击UITableViewCellAccessoryDe​​tailDisclosureButton时显示选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆