简体   繁体   English

如何在UICollectionView中添加按钮以插入新数据?

[英]How to add button in UICollectionView for inserting new data?

Good day! 美好的一天! On the screen below you can see how the user could add new players. 在下面的屏幕上,您可以看到用户如何添加新玩家。 By touching the cell with "plus" new cell with the name of player (for ex. "Player 3") will be inserting. 通过用“加号”触摸该单元格,将插入具有播放器名称(例如“ Player 3”)的新单元格。 And cell with "plus" will shift down. 并且带有“加号”的单元将向下移动。 在此处输入图片说明 Will you advice how to do this? 您会提出建议吗? thx for answering:) 谢谢回答:)

基本上,您每次都要确保+按钮是collectionView中的最后一项,并在numberOfItemsInSection方法中将项目数增加1。

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

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