如何設置gridview的重力,我使用了下面的代碼,但這段代碼不工作。如何設置Gridview的引力?
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:gravity="center"
android:layout_gravity="center_horizontal">
<GridView
android:id="@+id/grdviewmainmenu"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:verticalSpacing="10dip"
android:horizontalSpacing="17dip"
android:numColumns="auto_fit"
android:columnWidth="80dip"
android:stretchMode="spacingWidth"
android:gravity="center" />
</LinearLayout>
我使用Relative Layout,Thanks Droid完成了這個任務。 – 2011-05-12 10:06:01