• Post Reply Bookmark Topic Watch Topic
  • New Topic

variable in xml layout

 
simone giusti
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need to change background color in listview item, based on a variable value.



How can ho do that ?

I have an hashmap reporting CUENAME and BACKGROUNDCOLOR (@myvalue)
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

If the variable is going to take on different values at runtime, then I think you'll have to change your background programmatically using something like the following:



Hope this helps.
Darryl
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!