Bug 51489 - Setting view's background property to a ColorDrawable does not draw the background color properly.
Summary: Setting view's background property to a ColorDrawable does not draw the backg...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2017-01-12 17:06 UTC by Ryan Timmerman
Modified: 2017-08-23 21:10 UTC (History)
3 users (show)

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

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ryan Timmerman 2017-01-12 17:06:14 UTC
Setting the view's background via the 'Background' property to a ColorDrawable causes the view to redraw incorrectly and only portions of the view's background changes colors.

(in my case the view is part of a list view item - retrieved in an ArrayAdapter) 


Example of setting the background drawable via the 'Background' property with a ColorDrawable:

using Android.Graphics.Drawables;
ColorDrawable _green;
myUiWidget.Background = _green;

Result: Only portions of the view's background are drawn with the _green color.


The following behavior is what I expected when I set the background property to a ColorDrawable.

Example of setting the view's background color via SetBackgroundColor:

using Android.Graphics;
Color _green;

Result: The view's entire background is updated to the Color.

Could the 'Background' property's setter be missing code that forces a redraw?
Comment 1 Tom Opgenorth 2017-06-25 21:17:50 UTC
Thank you for taking the time to submit the bug. We are unable to reproduce this issue. Please attach a reproduction to the bug by starting with a clean Xamarin.Android project and adding just the code necessary to demonstrate the issue.
Comment 2 Cody Beyer (MSFT) 2017-08-23 21:10:31 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!