iPhone:在表视图的第一行插入新行
我从标记为 to、from 和 message 的三个文本字段捕获值。
当用户填写这三个文本字段并点击按钮时,我需要将这三个文本字段中的值显示在表视图的新行 1 中,即新行应该是向下推动先前存在的行的第一行。
我该怎么做?
问候, 希希尔
I capture values from three text fields labeled to, from and message.
When the user fills in these three text fields and hits a button, I need the values in these three textfield to be displayed in a new row 1 of a table view i.e. the new row should be the first row pushing the previously existing rows downward.
How can I do this?
Regards,
shishir
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
定义表视图行的数据将保存在某种类型的数据集合中,例如数组。您需要添加新数据以将字段中的数据插入到数组的第一个索引位置。当表格重新加载时,其数据源将按顺序读取数组,新数据将自动出现在表格视图的第一行。
The data that defines the rows of your tableview will be held in data collection of some kind such as an array. You need to add the new data to insert the data from the fields into the first index position of the array. When the table reloads, its data source will read the array in order and the new data will appear in the first row of the tableview automatically.