Maarten
Maarten

Reputation: 7338

Padding bars remain when scrolling GridView

I have this GridView (see screenshot) that contains items that all need about 12 dip spacing. However, when I set padding on the GridView, it seems that I can't scroll across this paddingm which I do want to do. How do I achieve this?

Note the slice of space above the top two pictures that I want to scroll away from:

screenshot while scrolling

Code:

<GridView
    android:id="@+id/feed_grid"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:columnWidth="96dp"
    android:gravity="center"
    android:horizontalSpacing="@dimen/grid_view_margins"
    android:numColumns="auto_fit"
    android:padding="@dimen/grid_view_margins"
    android:stretchMode="columnWidth"
    android:scrollbarStyle="outsideInset"
    android:verticalSpacing="@dimen/grid_view_margins" />

Upvotes: 25

Views: 3659

Answers (1)

Shashank Tomar
Shashank Tomar

Reputation: 862

android:clipToPadding="false" will solve your purpose

Upvotes: 51

Related Questions