How to add a switch to your listview or make it look that way…
@Kleyber_Derick asked me if i had an idea how to add a switch to a listview. The listview should just have a Name and a Switch.
It is not possible to add a switch component inside the Listview but in the Listview Image and Text you can put an image. I choose to use two images.
Then i used the following blocks to make everything work:
I use a separate list name itemchecked who keeps score of what image is used in the listview for every item.
When the value is 0 then it is switch-off-icon. If the value is 1 then it is switch-on-icon.
So now i can check and change the image of the item clicked with the update item block to get the following effect.
If you want you could store the itemchecked list in a TinyDB everytime something changes. So the switch positions could be saved this way and loaded when you start the app.
If someone wants to try here is the aia-file
listviewimagetextswitch.aia (16.3 KB)