문제

actually I'm developping an android application .The problem that I want to change the background color for a TextView using a color code that is exported from my database but it works only with CSS (bgcolor), I tried a few kinds of conversions but I n 'I could not solve this problem thank you for helping me examples of color codes from my database : #66FF33 , #CC99FF

도움이 되었습니까?

해결책

I am assuming your database stores the color in a String format... try this:

theViewYouWishToChange.setBackgroundColor(Color.parseColor(myStringWithAColor));

다른 팁

Color.parseColor("#rrggbb")

i think this is what you want right?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top