UITableView编辑模式显示自定义按钮 [英] UITableView Edit Mode Show Custom Buttons

查看:46
本文介绍了UITableView编辑模式显示自定义按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道人们在这里讨厌模糊的问题,所以我只需要是或否的答案.我有一个tableView,希望人们能够编辑表的内容.

I know that people hate vague questions here so I just need a yes or no answer. I have a tableView and I want people to be able to edit the contents of the table.

我喜欢setEditing方法,但是我不希望按钮显示删除"-我更喜欢删除",并且有时我想显示多个按钮并隐藏删除"按钮.我只想知道这是否可能.

I like the setEditing method but I don't want the button to say Delete - I would prefer Remove and there are times where I want to display more than one button and hide the delete button. I just need to know if this is possible.

我准备放弃使用标准的编辑"和删除"按钮,而是自己制作,但在我想做之前,我想知道有什么可能.

I am ready to give up on using the standard edit and delete buttons and just make my own but before I did I wanted to know what was possible.

非常感谢谢丽尔

推荐答案

只需在您的UITableViewDelegate上实现此方法:

Just implement this method on your UITableViewDelegate:

- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath

然后,您可以设置该删除按钮的标题,并改为显示删除".

Then you can set the title for that delete button and make it say "Remove" instead.

这篇关于UITableView编辑模式显示自定义按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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