Bryan.C
Bryan.C

Reputation: 53

Android Staggered Gridview Layout

have anyone done the same layout as fig. 1? i am currently using StaggeredGridLayoutManager but the result is fig 2. could anyone help me regarding this?

Ps tried using grid layout but it just copy the height of the largest height enter image description here

Upvotes: 0

Views: 443

Answers (1)

Android Geek
Android Geek

Reputation: 9225

Use GridLayoutManager instead of StaggeredGridLayoutManager for achieving same layout as fig. 1

GridLayoutManager creates the equal height grids.

val gridLayoutManager = GridLayoutManager(this, 2)
recyclerview.layoutManager = gridLayoutManager

Upvotes: 2

Related Questions