使用 UITableViewCellEditingStyleInsert 复制表格行?

发布于 2024-08-12 18:17:24 字数 405 浏览 4 评论 0原文

我有一个基于核心数据书籍示例的应用程序,我得出的结论是,我需要让用户能够复制表中的一行(一组数据),然后让他们编辑这些数据,而不是总是让他们从头开始创建新记录。

我正在考虑使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱殇璃 2024-08-19 18:17:24

也许有类似编辑的状态,点击“+”按钮或当前用于创建新项目的任何 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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文