Android Question [SOLVED] Use HEX value to set view color

Discussion in 'Android Questions' started by RandomCoder, Apr 3, 2015.

  1. RandomCoder

    RandomCoder Well-Known Member Licensed User

    This was driving me nuts! After finding this post I figured it could be done...
    But everything I tried resulted in just the default colour being applied, at least that's what I thought was happening. The colour values I was using were taken from the Material guidelines website.
    After some serious head scratching and self-doubt, I've worked out what is wrong!
    @Erel example should have be written as...
    Code:
    Activity.Color = 0xFFE4E4E2
    Where FF is the alpha value required, either fully opaque (FF) or fully transparent (00). This might seem obvious to most of you but I gave up on it late last night and it's only with a fresh set of eyes that I've realised what I was doing wrong. Hope it helps others having similar trouble.
     
    yiankos1, stanks, Dave O and 6 others like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice