Grouped ListView items on Android are being overwritten by headers

So I've created a simple list, which has items (grades) grouped by their date (year and month, specifically). The system works fine on Windows Phone, but not on Android - there, the headers override the list elements, and I end up with a list of headers if I scroll too much. Reloading the page works, of course, but it is pretty annoying.

The items are of a custom cell, based on ViewCell, with renderers on each platform. On Android, it uses a simple CellRenderer, where GetCellCore returns an XML layout inflated within (and values set, of course). The issue persists no matter if I have a custom group header or not. If I use a pre-defined Cell, even a ViewCell, it works.

Why is this happening?

Answers

  • RafaelMouraRafaelMoura BRInsider, University, Developer Group Leader ✭✭✭
  • Info-FrameLtdInfo-FrameLtd HUMember ✭✭

    I've read that article you linked three times now, but I can't find a reference to my issue. My problem is not scrolling to a specific list element, but the fact that instead of the cells I want to see (the custom cells I made the renderer for) the visuals are changed to the group headers. So say, I have my grades grouped by months, and displayed like this ( "(" and ")" marks group headers, otherwise regular list items):

    (2015 Mar)
    F, English Literature, 2015.03.11
    B, Maths, 2015.03.05
    A, Physics, 2015.03.04
    (2015 Feb)
    [more grades here]

    Instead of this, I see the following, after scrolling:

    (2015 Mar)
    2015 Mar
    2015 Mar
    2015 Mar
    (2015 Feb)
    2015 Feb
    2015 Feb
    2015 Feb
    2015 Feb
    2015 Feb
    (2015 Jan)
    2015 Jan
    2015 Jan
    2015 Jan

    And so on. The actual list elements are still clickable, and work as intended, but the visuals change when I scroll.

  • I'm actually having almost this exact same issue. The group header items are all that populate. When I take out the group header property in the list view element I can then see my items from my item template.

  • Info-FrameLtdInfo-FrameLtd HUMember ✭✭

    I found an albeit dirty, but working solution.

    I was inflating my XML layouts in the CellRenderer, but when I moved it out into a separate class and initialized that, it started working how it was supposed to.

Sign In or Register to comment.