0

I have followed a gallery tutorial and have it working fine, but the problem that I need help solving is that I want to change the background colour of the gallery. If I just use:

setBackgroundColor(Color.BLACK);

then it messes up and I lose the border also. I want to keep the border, but change the colour from the default grey. I've also tried using different resources such as:

R.styleable.gallery1_android_colorBackground

but that also does not work. Does anyone have any idea how to solve this?

Cheers

bstpierre
  • 30,042
  • 15
  • 70
  • 103
user1281053
  • 387
  • 1
  • 5
  • 10

1 Answers1

0

In your getView() from your ImageAdapteradd the following attribute:

imageView.setBackgroundColor(Color.BLACK); 

Hope this help.

113408
  • 3,364
  • 6
  • 27
  • 54
  • I've tried this already, but it also gets rid of the border, which I'd like to keep. – user1281053 Jun 12 '12 at 10:15
  • see this post : http://stackoverflow.com/questions/9027663/how-to-change-border-thickness-around-images-in-hellogallery I think you have to redefine the border from xml. – 113408 Jun 12 '12 at 10:28