Search code examples
androidandroid-layoutandroid-gallery

Android Gallery Background


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


Solution

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

    imageView.setBackgroundColor(Color.BLACK); 
    

    Hope this help.