Android GridView中包含不同的项目
我跟踪了Hello grid view turtorial。我想知道是否有一种方法可以在网格视图中沿图像的一侧添加按钮?如果是这样的话,我该怎么做呢?您可以尝试以下方法:Android GridView中包含不同的项目,android,gridview,Android,Gridview,我跟踪了Hello grid view turtorial。我想知道是否有一种方法可以在网格视图中沿图像的一侧添加按钮?如果是这样的话,我该怎么做呢?您可以尝试以下方法: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.c
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="300dp"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
/>
<Button
android:id="@+id/bAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add RES"
android:layout_below="@+id/gridview" />
</RelativeLayout>
希望能有所帮助。这是可能的,因为所有小部件都是视图的子类。请查看此项。这将在GridView旁边添加一个按钮,但不会添加到GridView中的每个项目。我明白了,在这种情况下,我建议查看