Formatting lost when using ListViewCachingStrategy.RecycleElement with FormattedString

GarethWynnGarethWynn USMember ✭✭
edited September 2016 in Xamarin.Forms

I'm attempting to move a ListView in my app to use the RecycleElement ListViewCachingStrategy. The DataTemplate for the list view items has a Label with the Text property bound a property in the view model that returns a FormattedString, in order to make some parts of the text appear bold. This works correctly with RetainElement, but with RecycleElement the formatting appears correctly initially, but after scrolling through some items in the list it is lost and the text appears without any of the formatting. Can anyone help? Is this a limitation of this caching strategy or possibly a bug?


  • JohnHardmanJohnHardman GBUniversity mod

    @GarethWynn - There are multiple bugs logged in Bugzilla about RecycleElement. Take a look at

    I raised one recently, where having one DataTemplate set IsEnabled for a ViewCell to false, resulted in other ViewCells (for which the related DataTemplate is explicitly setting IsEnabled to true) also end up disabled, which they should not. It seems there is some odd stuff around RecycleElement currently.

  • GarethWynnGarethWynn USMember ✭✭

    Thanks John. I think I'll steer clear of RecycleElement for now. Maybe I'll investigate further when I have more time.

  • EmanueleSabettaEmanueleSabetta ITBeta ✭✭✭

    I have the same problem. Is there a workaround for this? Without Recycling the listview scroll is too slow and sloppy.

  • csampaio01csampaio01 PTMember ✭✭✭

    @GarethBrown Did you solve this? I am having the same problem.

  • Hikari91Hikari91 ITMember ✭✭
    edited January 8

    Solutions about this?
    I have a custom renderer inside a ViewCell that lose formatting if I set CachingStrategy to RecycleElement to the ListView :(

Sign In or Register to comment.