Bug 42280 - Frame changing background colour in ListView
Summary: Frame changing background colour in ListView
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-30 15:17 UTC by Filip Drsek
Modified: 2017-11-05 08:23 UTC (History)
4 users (show)

Tags: Android ac
Is this bug a regression?: ---
Last known good build:


Attachments
Visual Studio solution demonstrating the problem (205.85 KB, application/x-zip-compressed)
2016-06-30 15:17 UTC, Filip Drsek
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 42280 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Filip Drsek 2016-06-30 15:17:01 UTC
Created attachment 16533 [details]
Visual Studio solution demonstrating the problem

I have difficulties when running on Android (I cannot test it on iOS) an application in which there is a “ListView” control with an item template including a “Frame” control that is expected to change its background colour when selecting and unselecting the item. I attach a Visual Studio solution demonstrating the problem. In the solution I put the latest stable version 2.3.0.107 of Xamarin.Forms. The “ListView” control is modified to support multiple selection. The background colour of a selected item should be “Aqua” and the background colour of an unselected item should be “White”. Furthermore, the text colour of the main title of an item should be “Pink” when selected and “Gray” when not selected. When selecting for example the first item (and no other one) and scrolling further on, I see that not only one item has the “Aqua” background colour, and if I select another item after scrolling, its text colour changes as expected, but no longer its background colour. When scrolling back to the beginning and tapping for example the third item, we see that another item than the selected one changes its background colour. This strange behaviour seems to be due to the use of the “CorrectedFrameRenderer” renderer in the “LVTest.Droid” project. When the renderer is removed or the command “base.SetBackgroundColor(color);” in the renderer is not commented out, the background colour behaves as expected, but once the “Frame” control changes its background colour while it is already on the screen, it loses its rounded corners. I need to get rid of both the problem of background colour changing of the selected item in a “ListView” control and the problem of disappearing rounded corners of a “Frame” control, but now the situation is such that solving one of these problems causes the other problem to appear.
Comment 1 E.Z. Hart [MSFT] 2016-07-08 23:00:59 UTC
It looks like the ListView's idea of which views correspond to the selected items is getting out of sync. For example, run the attached project and select the first item in the list. Now de-select it and scroll to the bottom of the list. Scroll back to the top and select/deselect some items - you'll see the backgrounds changing on other items than the one you're trying to select.

This is still occurring up through 2.3.1.111-pre2.