Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove border in Android Gallery widget?

Tags:

android

How would one go about removing the ugly grey boarder around the Gallery images?

like image 964
Aaron Decker Avatar asked Dec 28 '22 23:12

Aaron Decker


2 Answers

Exclude this line in your ImageAdapter to stop loading of that preset:

//imageBackground = ta.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 1);

Images might be overlapping after this, so go into your main.xml or whatever you are using for styling and add this to your Gallery, for padding around your gallery images, like a transparent border:

android:spacing="10px"

So that now the Gallery part of the XML will read:

<Gallery 
android:id="@+id/Gallery01" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content"
android:spacing="10px">
</Gallery>
like image 95
alyx Avatar answered Dec 30 '22 11:12

alyx


Another way is setting yourGallery.setUnselectedAlpha(1); The last answer bring me troubles in other things. Excuse me for my english!

like image 20
SolArabehety Avatar answered Dec 30 '22 13:12

SolArabehety