简体   繁体   English

在回收站视图中添加带有复选框的新行(如 google keep)

[英]Adding new line with checkbox inside recycler view (like google keep)

I have a recyclerview for "steps" list with checkbox and i want to add a new "step" everytime i hit the new line key on keyboard Google keep example我有一个带有复选框的“步骤”列表的recyclerview,我想在每次点击键盘上的新行键时添加一个新的“步骤”谷歌保持示例

As in the picture, everytime you hit the new line key, a new line with a checkbox automatically appears and is automatically focused.如图所示,每次按下换行键时,都会自动出现一个带有复选框的新行并自动聚焦。

For now, i have a recycler view with a viewholder that have the checkbox.现在,我有一个带有复选框的回收器视图。 but i want to know if recyclerview is the best way to do it or there is another way.但我想知道 recyclerview 是不是最好的方法,还是有另一种方法。 Thanks in advance!提前致谢!

You can use a custom adapter for your recyclerView.您可以为您的 recyclerView 使用自定义适配器。 This would be easier to handle added functionalities for your checkbox inside recycler view.这将更容易为回收站视图中的复选框处理添加的功能。

Call notifyItemChanged() eachtime your enter a new item in the list.每次在列表中输入新项目时调用notifyItemChanged()

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

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