How I can solve the strange behaviour in my ListBox in Firemonkey?

  

I have posted some days ago because I am developing a Mobile app in Firemonkey and in the main class there is a ListBox with some items which change their custom style when the user scrolls to see the rest of items in this ListBox:

Items change style after do scrolling

I have done some test to determine because my app has this behaviour.

I have shown the same items obtained from my database but without a custom style, it only shows a text with the name and in this case the behaviour when I do scroll is correct, the items does not change their position in the ListBox.

After, I have created a simple custom style, a Layout with a Text where I show the item’s name. When I have simulated my app, if I scroll the name in the Text of each item disappears and it not is seen the text in each item.

Moreover, I have modified the custom style and I have added a Rectangle to a Layout for showing a different background colour in each item. In this case, after scroll, the Text does not disappear but the items change their position in the ListBox and the items are not sorted like before scroll.

You can test all this of a simple way, creating a ListBox without custom style and with a simple custom style (Layout with Text).

I do not understand this behaviour of the ListBox when you apply a custom style. I will be very grateful if you could help me.

Thanks XD

Comments are closed.