使用 UITableViewCellEditingStyleInsert 复制表格行?
我有一个基于核心数据书籍示例的应用程序,我得出的结论是,我需要让用户能够复制表中的一行(一组数据),然后让他们编辑这些数据,而不是总是让他们从头开始创建新记录。
我正在考虑使用 UITableViewCellEditingStyleInsert 编辑控件来执行此操作 - 用户会在按一下后发现它重复了一个条目并且不会插入新条目 - 因为我使用导航栏中的“+”按钮来添加新记录。
不过,我无法使用标准 TableCell 定义来执行此操作 - 因为我只能删除或插入,而不能同时执行两者,所以我假设我必须创建一个自定义表格单元格才能执行此操作。
还有其他不会用一堆额外的“东西”堵塞用户界面的建议吗?由于我在导航栏中已经有一个“编辑”按钮,因此这似乎是“删除”操作的逻辑扩展,以某种方式添加“复制”操作。
谢谢,
-t
I have an application based on the Core Data Books example, and I'm coming to the conclusion that I need to give the user the ability to duplicate a row in the table - a set of data - and then let them edit this data, rather than always have them create a new record from scratch.
I was considering using the UITableViewCellEditingStyleInsert editing control to do this - the user would figure it out after one press that it duplicates an entry and does not insert a new one - since I use an "+" button in the Navigation Bar to add new records.
I cannot do this with a standard TableCell definition though - since I can only have Delete or Insert and not both, so I assume I'll have to create a custom table cell to do this.
Any other suggestions that will not clog up the UI with a bunch of extra "stuff?" Since I already have an "Edit" button in the Navigation Bar, it seems a logical extension to the Delete action to somehow add a Copy action.
Thanks,
-t
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许有类似编辑的状态,点击“+”按钮或当前用于创建新项目的任何 UI 会将表格置于编辑模式,其中所有插入而不是删除,并带有“添加新”行、联系人-样式,在底部?
Maybe have an editing-like state, where hitting the "+" button or whatever UI you currently have for creating a new item instead puts the table in editing mode with all Inserts instead of Deletes, with a "Add new" row, Contacts-style, at the bottom?