grridview


GridView
itemView(自定義)
baseAdapter

gridview


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <GridView  
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:id="@+id/main_page_gridview"
        android:numColumns="auto_fit"
     android:gravity="center"
     android:columnWidth="50pt"
     android:stretchMode="columnWidth"
    />

</LinearLayout>

itemview


    <TextView
        android:id="@+id/account_item_Name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:text="Account 1"
        android:layout_marginTop="5dp" />

   

itemview

 <ImageButton
        android:id="@+id/account_item_Picture"
        android:layout_width="35dp"
        android:layout_height="35dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="15dp"
        android:layout_marginRight="26dp" />


grridview

By Zhenghong Li (hambuger)