xamarin/Xamarin.Forms

[Bug] Inconsistent Xamarin Forms frame background color

Open

#5,950 opened on Apr 18, 2019

 (6 comments) (0 reactions) (0 assignees)C# (1,926 forks)batch import
e/4 :clock4:help wantedinactivep/Androidt/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description While I was designing an application with Xamarin.Forms I realized that the Android version is unable to reproduce a hexadecimal color with accuracy, the color shows it with less intensity with respect to the real color, however, the IOS version reproduces the color perfectly.

The problem is explained in the following repository: "In Xamarin Forms on iOS, the frame control background color does not match the color of other elements due to differences between CGColor and UIColor.

Most iOS renderers work using UIKit and UIColor. The background color for instance is set using UIView.BackgroundColor.

Frame however works using CoreGraphics and CGColor and manipulating a view's layer. The background color is set using UIView.Layer.BackgroundColor."

Steps to Reproduce

  1. Compare the color differences between a Android and IOS.

Expected Behavior That colors appear the same on all devices.

Actual Behavior Currently there are differences in color contrast depending on the device in which it is executed.

Basic Information

  • Version with issue: 3.6.0.344457 and previous versions.
  • Platform Target Frameworks: Android: 8.1, 9

Application example where the problem is reproduced: https://github.com/GalaxiaGuy/xamarin-forms-frame-color

Contributor guide