質問

下図のようにFramelayout内にGridViewがあります。

GridView画面

見て、数字は画面の左側に近づく。私は問題を解決できるが失敗するように、私は数字を近づけようとしました。'columnwidth'のようにストレッチモードで遊んで遊んで、 'なし'は私の問題を解決できませんでした。私がバックグラウンドホワイトエリア内に数字に合うことができるように私に提案してください。

.xmlファイル:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >


<FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <GridView
        android:id="@+id/gridview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/paperbck"
        android:columnWidth="30dp"
        android:gravity="center"
        android:horizontalSpacing="20dp"
        android:numColumns="4"
        android:stretchMode="columnWidth"
        android:verticalSpacing="20dp" />


</FrameLayout>

</LinearLayout>
.

役に立ちましたか?

解決

グリッドビューに余白を与えてみてください。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top