Creating a list of Contacts in ListView

How do I put contact lists in ListView? I want to put the contact name and the phone number in one list item, such that they are stacked on top of each other but still considered as one list item. I also need to put 2 contacts that are in default while users can add as many contacts as they need in the next list items.

Similar to this picture

Sample project:

2 Likes

Using the Designer section, I was able to add items to the list (Image, Main Text, Detail Text) as shown here in this picture. But when I try to add a contact, the items in the list earlier disappear, why?


the elements should be a list of dictionary, but you are making it a list of list.

you can use the createElement function to add one element.

ps, nice UI .

Update:

The items in the list do not disappear anymore after adding a contact. (Thank You!)

However, when I add a contact it does not add to the list

Here is what happens when I add a contact, nothing happens but the list item "Add Contact" became darker as if I am still holding it down.

Here are the blocks that I used:

Looking at your code briefly, you may need to somehow update the ListView after updating the list. I am not too sure about this though. This is just a suggestion for a direction to head in.