在Android的画廊插件删除边界?画廊、边界、插件、Android

2023-09-05 08:25:38 作者:当青春期遇上更年期△

如何将一去各地的画廊图像去除丑陋的灰色边界?

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

推荐答案

排除这一行你ImageAdapter停止装货的preSET:

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

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

图像,可能是在此之后的重叠,因此​​进入你的main.xml或任何你正在使用的样式,并添加到您的画廊,对周围填充您的画廊图片,就像一个透明的边框:

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"

所以,现在的XML的库部分将改为:

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>