How to have different Backgrounds and colors for dividers in GridView?
Asked Answered
F

0

7

I wish to keep different colors for the divider and background in my GridView. Or I would like to hide the background color visible around the Gridview. I tried changing layout_margin & padding parameters, but that did not change anything. Following is the xml layout for my GridView.

<GridView android:id="@+id/gvFree" 
           android:layout_width="fill_parent"
           android:layout_height="0dp" android:layout_weight="1"
           android:columnWidth="@dimen/grid_col_wd"
           android:background="@android:color/darker_gray"
           android:layout_margin="-5dp"
           android:padding="-5dp"
           android:numColumns="auto_fit"
           android:stretchMode="columnWidth"
           android:gravity="fill"
           android:horizontalSpacing="2dp"
           android:verticalSpacing="2dp"
           ></GridView>

Kindly help.

image

Fonville answered 11/11, 2012 at 15:53 Comment(4)
Remove spacings and create borders for your rowsCortisol
there are some solutions about dividers here: #12109626Bedwell
#12109626 check this outTinsley
we can add GridView background and divider color for GridView.Brother

© 2022 - 2024 — McMap. All rights reserved.