如何自定义在滑动UITableViewCell时显示的Delete按钮 [英] How to customize the Delete button shown when swipe a UITableViewCell

查看:53
本文介绍了如何自定义在滑动UITableViewCell时显示的Delete按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表视图,并通过提供-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)EditingStyle forRowAtIndexPath:(NSIndexPath *)indexPath .当我向左滑动表格单元格时,我会看到一个红色的删除"按钮.但是,尽管系统区域设置不是英语,但按钮的标签还是删除".我也有问题1.我希望根据区域设置对删除"按钮进行本地化.2.我想添加一些其他按钮,例如在Apple的Podcast应用中.

I have a table view and enabled the swipe to delete feature by providing an empty implementation of - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath of the table view controller. I can see a red 'Delete' button when I swipe left the table cells. But the button's label is 'Delete' despite that the system locale is not English. I have too problems. 1. I want the Delete button to be localized according to the locale. 2. I want to add some other button, like that in the Podcast app of Apple.

推荐答案

解决方案太多...在发布新问题之前,应先进行搜索.检查此链接:

there is too much solutions... you should to search before posting new question. check this link:

iOS编程101:如何创建可滑动表格视图单元以显示更多选项

或使用现成的解决方案,如下所示:

or use ready-made solutions like this:

https://github.com/CEWendel/SWTableViewCell

没有10个声誉,我无法发布太多链接,因此请尝试使用Google自定义删除按钮uitableviewcell"

i can't post much links without 10 reputation, so try to google "custom delete button uitableviewcell"

这篇关于如何自定义在滑动UITableViewCell时显示的Delete按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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