在ImageAdapter中排除此行以停止加载该预设:
//imageBackground = ta.getResourceId(R.styleable.Gallery1_android_galleryItemBackground, 1);
Run Code Online (Sandbox Code Playgroud)
此后图像可能会重叠,因此请进入main.xml或用于样式设置的任何内容,并将其添加到图库中,以便在图库图像周围填充,如透明边框:
android:spacing="10px"
Run Code Online (Sandbox Code Playgroud)
那么现在XML的Gallery部分将会读取:
<Gallery
android:id="@+id/Gallery01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:spacing="10px">
</Gallery>
Run Code Online (Sandbox Code Playgroud)