Android 网格视图上的边框图像

Android 网格视图上的边框图像,android,android-gridview,Android,Android Gridview,我有一个这样的网格视图 <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/aldiko_shelf_background" android:colum

我有一个这样的网格视图

<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/aldiko_shelf_background"
android:columnWidth="40sp"
android:gravity="center"
android:horizontalSpacing="20dp"
android:numColumns="auto_fit"
android:paddingLeft="20sp"
android:paddingRight="20sp"
android:smoothScrollbar="true"
android:stretchMode="columnWidth"
android:verticalSpacing="30sp" />


我想添加一个图像作为总网格的边界,并想在两行之间添加另一个图像,如下所示

<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/aldiko_shelf_background"
android:columnWidth="40sp"
android:gravity="center"
android:horizontalSpacing="20dp"
android:numColumns="auto_fit"
android:paddingLeft="20sp"
android:paddingRight="20sp"
android:smoothScrollbar="true"
android:stretchMode="columnWidth"
android:verticalSpacing="30sp" />

据我所知,有两种方法可以做到这一点,一种是简单的,另一种不是那么简单

首先,简单的一个->尝试放置背景图像,例如:书架图像

其次,->您可以修改XML中的行视图,以便在图像之间有一个图像


我想你需要的是书架式的布局试试这个

酷。你的问题是?我想添加一个图像作为总网格的边框,并想在两行之间添加另一个图像,看起来像这样,但不知道该向谁添加此边框图像和下面的行图像为什么你不能用ListView尝试此操作?我需要使每个图像都可单击在列表视图中如何使每个图像都可单击一行中的每一个图像第二行的任何示例请不要否决投票我是Android的新手您可以做的是首先通过放置另一个图像(线条图像)来编辑图像布局在网格图像的底部。接下来在网格图像上添加填充,使d线图像超过网格图像的d宽度。现在应该可以了。如何在网格视图中放置另一个图像您将使用另一个布局,该布局中的图像将显示在该网格视图中。我已使用链接编辑了我的答案,请仔细阅读,我想这就是你需要的