在网格布局中自动添加新项目 android studio

Add new item automatically in Grid layout android studio

我今天在用笔记应用 在那个应用程序上,如果我删除任何音符,它会自动将第二个音符放在第一位。 我也想在我的应用程序中这样做

这怎么可能? 我像这个问题一样在互联网上浏览,但我对这个话题知之甚少。 帮我看看怎么做。

基本上,笔记应用程序使用的是 RecyclerView,其布局采用网格形式。当您删除注释时,由于称为 notifyItemRemoved() which basically takes the position of the adapter and removes it from the position it held. on the details of how to implement it in your project you can look up this previous answer 的机制,它会自动更新为已删除注释下方的注释。希望这能让您对 android 发展

的美妙之处有所了解