删除部分(红色删除按钮),UITableViewController-iOS [英] Delete section (red delete button), UITableViewController - iOS
问题描述
我正在尝试进行分组的uitableview,并且我已经激活了编辑选项.我希望用户也能够删除整个部分,而不仅仅是特定的行.
因此,当您单击EDIT时,每个表格单元格左侧显示的红色减号按钮也应显示在各节中(该节标题的左侧).
有人知道这样做的方法吗?
I'm trying to do a grouped uitableview and I have activated the edit option. I want the user to be able to delete the whole section too, not only specific rows.
So, when you click EDIT, the red minus button that shows on the left of each table cell, should show up for sections (left of the section title) too.
Anyone knows a way to do this?
在此先感谢大家!
奥尔西.
Thanks in advance to everyone!
Olsi.
推荐答案
没有开箱即用的方法.您需要花哨的时间并在表视图委托的 tableView:viewForHeaderInSection:
方法中返回自定义视图.进入编辑模式时,您必须在这些视图中添加一个删除按钮.
There's no way to do it out of the box. You'll need to get fancy and return a custom view in your table view delegate's tableView:viewForHeaderInSection:
method. When you enter edit mode, you'll have to add a delete button to those views.
这篇关于删除部分(红色删除按钮),UITableViewController-iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!