Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75e505c

Browse files
committed
Readme updates for column_count attribute
1 parent 64aed6a commit 75e505c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,18 @@ Usage
5353

5454
1. Add the `StaggeredGridView` to the layout you want to show.
5555
```xml
56-
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
57-
xmlns:app="http://schemas.android.com/apk/res-auto"
58-
android:layout_width="match_parent"
59-
android:layout_height="match_parent">
60-
6156
<com.etsy.android.grid.StaggeredGridView
57+
xmlns:android="http://schemas.android.com/apk/res/android"
58+
xmlns:app="http://schemas.android.com/apk/res-auto"
6259
android:id="@+id/grid_view"
6360
android:layout_width="match_parent"
6461
android:layout_height="match_parent"
6562
app:item_margin="8dp"
66-
app:column_count_portrait="2"
67-
app:column_count_landscape="3" />
68-
69-
</FrameLayout>
63+
app:column_count="@integer/column_count" />
7064
```
7165
2. Configure attributes.
7266
* `item_margin` - The margin around each grid item (default 0dp).
67+
* `column_count` - The number of columns displayed. Will override column_count_portrait and column_count_landscape if present (default 0)
7368
* `column_count_portrait` - The number of columns displayed when the grid is in portrait (default 2).
7469
* `column_count_landscape` - The number of columns displayed when the grid is in landscape (default 3).
7570
* `grid_paddingLeft` - Padding to the left of the grid. Does not apply to headers and footers (default 0).

0 commit comments

Comments
 (0)