locked
Color not showing on Android RRS feed

  • Question

  • User125514 posted

    I have a piece of code to get a colour for rendering BoxView from a UInt RGB value:

    BackgroundColor = Color.FromUint((uint)cell.Colour)

    On Windows Phone this works perfectly, but on Android, the colour is always rendered as white. What as I missing?

    Thursday, February 4, 2016 1:47 AM

Answers

  • User103165 posted

    Maybe you could use the Color.FromHex as a workaround?

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, February 4, 2016 9:05 AM

All replies

  • User103165 posted

    Try to set the Color instead. It's a bit confusing they are both there but the Color one seems to work.

    Thursday, February 4, 2016 7:51 AM
  • User125514 posted

    Thanks for the hint, didn't realise there were two settings. Sadly, it doesn't fix the problem.

    It is something to do with the FromUInt implementation. If I Set `Color = Color.Gray' then it works perfectly on both systems, if I set the INT value for grey, it only works in Windows Phone/Universal (don't have IOS to test), Android renders it as white.

    Thursday, February 4, 2016 9:03 AM
  • User103165 posted

    Maybe you could use the Color.FromHex as a workaround?

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, February 4, 2016 9:05 AM
  • User125514 posted

    Thanks. The Hex value does work, but I had to change the web service to send a hex string instead of an ARGB value as a UINT. Any processing on the Android side resulted

    Thursday, February 4, 2016 10:08 AM