网格视图上的边框图像

时间:2013-03-28 10:05:25

标签: 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: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" />

enter image description here

我想将图片添加为整个网格的边框,并希望在两行之间添加另一个图像,如下所示

enter image description here

1 个答案:

答案 0 :(得分:1)

据我了解你的问题,有两种方法可以做到这一点,一个简单的方法,一个不那么简单的方法

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

其次, - &gt;您可以修改XML中的行视图,使图像之间有图像

我认为您需要的是书架式布局,请尝试此tutorial