Skip to main content

Posts

Showing posts with the label Gridview with icon

Custom gridview/Grid View with icons/Grid View in Android/ Grid View with image

Custom gridview/Grid View with icons/ Grid View in Android/ Grid View with image Grid View with icons can be done using Base Adapter. Before start coding, collect some images and copy it into the resource folder.  Create a new project In the main . xml file, add the grid view <? xml version = "1.0" encoding = "utf-8" ?> <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:columnWidth = "90dp"      android:numColumns = "auto_fit"      android:verticalSpacing = "10dp"      android:horizontalSpacing = "10dp"      android:stretchMode = "columnWidth"      android:gravity = "center" /> In the activity, create an object of grid view as we did in previous example. (Grid View with text). Then gridview . setAdapter