Removing the extra padding in a GridView in android

前端 未结 5 765
心在旅途
心在旅途 2020-12-15 22:21

I want to remove the extra padding that appears in a grid view. I have images of the size 128*128 which will be occupying cells in the grid. But somehow there is an extra sp

5条回答
  •  孤街浪徒
    2020-12-15 22:58

    I had a similar problem, though in my case there was a quite large padding area at the bottom of my GridView (it was filled with the background color).
    I haven't seen the solution to my issue here, so I'll post it here in case it's helpful.

    Besides setting:

    android:listSelector="@null"
    

    in my GridView, I also had to set:

    android:fadingEdgeLength="0px"
    

    Or, in Java:

    GridView.setFadingEdgeLength(0);
    

提交回复
热议问题