Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Having trouble getting background on TextViews  RSS feed

Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

So right now I'm building an app on competitive Pokemon, and right now I am having issues getting specific background colors depending on the text views. The layout, essentially, will be the Pokemon name followed by the type; I want the type to be associated with a certain color. Grass will be green, Electric is yellow, etc. The idea is that the type will show up next to the Pokemon name.

I don't really know how to do it in XML, so what I did in the code was created an associative array for the types, as well as the colors. I mapped each type to a color, and tried setting the backgrounds, but no background color is showing up. Below is all relevant code:


//this is the view class

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!