简体   繁体   English

删除和添加随表行移动的按钮

[英]Delete and add buttons that move along with table rows

I need a feature similar to the contacts app. 我需要与通讯录应用类似的功能。 When you add a new contact address, a green plus button appears next to the table view to do so. 添加新的联系人地址时,表格视图旁边会出现一个绿色的加号按钮。 This button moves up and down and is almost locked to that table view cell. 该按钮上下移动,几乎锁定在该表视图单元格上。 But it is 'outside' of the table view. 但这是表视图的“外部”。

When you add one address field, the green plus is replaced with the red delete button, which again appears for all rows by the side of the table view, and scrolls together with the table view cells. 当您添加一个地址字段时,绿色的加号将替换为红色的删除按钮,该按钮将再次出现在表视图旁边的所有行中,并与表视图单元格一起滚动。

How can I replicate this behaviour in my custom app? 如何在我的自定义应用程序中复制此行为?

Use your UITableView in edit mode you will get it as default by allowing your UITableView to Add/Delete the cell from Table, 编辑模式下使用UITableView ,您可以通过允许UITableView从Table添加/删除单元格来将其作为默认设置,

Here is the tutorial link 这是教程链接

http://adeem.me/blog/2009/05/29/iphone-sdk-tutorial-add-delete-reorder-uitableview-row/ http://adeem.me/blog/2009/05/29/iphone-sdk-tutorial-add-delete-reorder-uitableview-row/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM