views:

452

answers:

1

Hello World!

Is their any way to apply a style resource to customize the Item Border in the Gallery Class with Android?

I'm trying to hide or change the color of the default Grey border but by the looks of things this isn't possible?

Any help or tips you can provide would be fantastic.

Appreciated,

Tom

+1  A: 

In the HelloGallery sample they state how to add the default gray border in step 5 by using an attrs.xml file. If you don't want the border you can simple skip this step.

In the next step an ImageAdapter is created, in the constructor they apply the border to all items. If you change the constructor to the following code the border should be gone and you should only have a row of your images left:

public ImageAdapter(Context c) {
    mContext = c;
    TypedArray a = obtainStyledAttributes(R.styleable.HelloGallery);
    a.recycle();
}

Also, in the getView method there's a line i.setBackgroundResource(mGalleryItemBackground); which can be removed in this case.

Hope this helps you a little bit in the right direction.

Piro
Ah fantastic!I couldn't believe I didn't think about simply just removing the reference to the resource.Cheers Piro!
iTom