WinPhone Listview - Crash - Layout Cycle detected, Xamarin forms 2.x (in Forms 1.5 working OK)

After upgrade my App from Xamarin forms 1.5 to 2.x (2.3.0.107), I have a big problem on Windows Phone - crashing - Layout Cycle Detected.

I have two ListView in tabbed page. One on each page. (I need 4 pages with ListView). Each Listview has several pictures on each cell and 100-300 rows.
On Form 1.5 all working properly. On Xamarin 2.0 crash on fist display listview.
On Forms 2.3.0.105 crash on quick scroll or on pop modal view controller that pushed over Tabbed page with listview. Crash propably in layout listview.

Can You help me? I currently stop developing WinPhone part of my project a continue only with iOS/Android target.

Thank You very much.

JP.

Answers

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @JiriPelikan.6366 - I experienced these issues with the new Layout engine in 2.x as well.

    There are only a few things you can do, unless you want to submit a repro to bugzilla.xamarin.com and wait for them to get around it.

    1. Reduce the complexity of your views. Try to make each ListView cell as simple as possible with as few elements as possible.
    2. Define a fixed height for your rows. If you know how big a cell will be, define its height so that it doesn't need to calculate it.
    3. Try ListView CachingStrategy to RecycleElement

    Let me know how that goes.

  • JiriPelikan.6366JiriPelikan.6366 CZMember ✭✭
    edited July 2016

    Hi,
    thank You for your reply.
    ad 1) crash even if cell contain only one image, that is not preloaded. My cell contain six preloaded images, one image with binded source property (path to local storage - in bundle), one label and one boxview. I mean, that problem is in loading imaged from local storage. The six preloaded images is binded too, but all possible values are preloaded and displayed via valueconverter (binded custom property is integer and images preloaded in imagesource arrays).
    ad 2) I tried both, but with no effect.
    ad 3) I tried both, but with no effect.

    I am sorry for my english.

  • JohnHardmanJohnHardman GBUniversity mod

    @JiriPelikan.6366 - Before working around the problem, can you log it as a bug please at https://bugzilla.xamarin.com . Xamarin have fixed a number of layout cycle issues already. If you have code that results in a layout cycle, they would find it useful to see that code so that they can resolve the problem in Xamarin.Forms .

    Once the bug is logged, @AdamP is correct that simplifying your page is the thing to try. Even if just to identify what triggers the issue, you might want to try various things. What happens if your ListView has no data rows? What happens if your ListView has one data row, but you remove the images, or you make all of the images preload without using bindings? What happens if you specify HeightRequest and WidthRequest on all elements within your cell?

Sign In or Register to comment.