0

我在 FrameLayout 中有一个 GridView,如下所示:

网格视图屏幕

如图所示,数字更靠近屏幕左侧对齐。我试图让数字更接近,以便我可以解决问题,但失败了。使用诸如“columnWidth”和“none”之类的stretchMode 无法解决我的问题。请建议我任何可以在背景白色区域内放置数字的方法。

.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>
4

1 回答 1

0

尝试为网格视图提供左边距。

于 2014-06-05T11:57:55.977 回答