Bug 41220 - Forms Frame BackGroundColor renders too light
Summary: Forms Frame BackGroundColor renders too light
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-05-20 15:29 UTC by ayal
Modified: 2016-06-14 18:01 UTC (History)
4 users (show)

Tags: BackCompat
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 ayal 2016-05-20 15:29:38 UTC
The Frame element background colour renders a shade too light for every colour.
Comment 1 Sebastien Pouliot 2016-05-20 17:06:01 UTC
Description makes it sounds like it's Xamarin.Forms related.
Comment 2 ayal 2016-05-20 17:32:12 UTC
It is the Forms frame element, but the lightened colour appears only on my iPhone (6s) and not on my Samsung Galaxy 4.
Comment 3 ayal 2016-05-23 15:20:05 UTC
For now, this fixes it for me, provided I always set the background and outline colour...

public class Button_iOS : FrameRenderer
		protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)

			// have to do this because Xamarin Forms Frame colour converts to a ligher shade
			if (e.NewElement != null) {
				// check for transparent colour
				if (!(e.NewElement.BackgroundColor.R == 0 && e.NewElement.BackgroundColor.G == 0 && e.NewElement.BackgroundColor.B == 0 && e.NewElement.BackgroundColor.A == 0))
					this.Layer.BackgroundColor = UIColor.FromRGB ((nfloat)e.NewElement.BackgroundColor.R, (nfloat)e.NewElement.BackgroundColor.G, (nfloat)e.NewElement.BackgroundColor.B).CGColor;

				if (!(e.NewElement.OutlineColor.R == 0 && e.NewElement.OutlineColor.G == 0 && e.NewElement.OutlineColor.B == 0 && e.NewElement.OutlineColor.A == 0))
					this.Layer.BorderColor = UIColor.FromRGB ((nfloat)e.NewElement.OutlineColor.R, (nfloat)e.NewElement.OutlineColor.G, (nfloat)e.NewElement.OutlineColor.B).CGColor;
Comment 4 Paul DiPietro [MSFT] 2016-06-13 15:01:25 UTC
Thank you for taking the time to submit this report. It is our policy to maintain backwards compatibility with existing apps to the best of our ability. Consequently, we must avoid modifying any functional UI behavior such as this. At this time, we will close and tag this issue for consideration in a future version of Xamarin.Forms.

Warm regards,
Xamarin Forms Team