Android 如何使栅格视图的宽度在屏幕上为100%

Android 如何使栅格视图的宽度在屏幕上为100%,android,android-layout,gridview,fill-parent,Android,Android Layout,Gridview,Fill Parent,我的布局中有一个网格视图,我正试图让它在屏幕上一直延伸。下面是这个gridview的XML <GridView android:numColumns="auto_fit" android:gravity="center" android:stretchMode="columnWidth" android:layout_width="fill_parent" android:layout_height="fill_parent" androi

我的布局中有一个网格视图,我正试图让它在屏幕上一直延伸。下面是这个gridview的XML

 <GridView
    android:numColumns="auto_fit"
    android:gravity="center"
    android:stretchMode="columnWidth"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/gridView"
    android:layout_below="@+id/editText"
    android:columnWidth="400dp"
    android:clickable="true"
    android:background="#fffefff9"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

栅格视图不能完全填满屏幕宽度。边上有这些小的边距。如何完全去除栅格视图两侧的这些边距?换句话说,我希望栅格视图的宽度为全宽。另一方面,fill_parent确实使网格视图的宽度覆盖了屏幕宽度的95%,但在屏幕的侧面有很小的边距。不幸的是,由于我没有足够的声誉,我不允许发布图像。

将此添加到列表视图的父视图中,它可能是线性布局或相对布局


如果已经有填充值,请将其更改为该值。

您可能在GridView的父级上设置了填充-如果没有布局的其他内容,几乎不可能准确回答您的问题。谢谢。我不知道布局中的填充标记。原来是16dp
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"