问题描述
我正在使用android material design api&想要以网格格式显示一些数据.我试过GridLayout
和StaggeredGridlayout
都看起来一样.有关一般信息,我想问 Gridlayout
和StaggeredGridlayout
有什么区别?
谢谢.
I am working in android material design api & want to display some data in grid format. I tried both GridLayout
and StaggeredGridlayout
and both look same. For general information, i want to ask what is the difference between Gridlayout
and StaggeredGridlayout
?
Thank you.
推荐答案
网格视图:这是一个ViewGroup
,用于在二维可滚动网格中显示项目.在这种情况下,每个 网格具有相同的大小(高度和宽度). 网格视图在视图中显示对称项.
Grid View : It is is a ViewGroup
that displays items in a two-dimensional, scrollable grid. In this each Grid is of same size (Height and width). Grid View shows symmetric items in view.
交错网格视图:它基本上是对Grid View
的扩展,但是在每个 网格中,网格的大小(高度和宽度)都是变化的 .交错网格视图在视图中显示不对称项.
Staggered Grid View : It is basically an extension to Grid View
but in this each Grid is of varying size(Height and width). Staggered Grid View shows asymmetric items in view.
实现交错网格视图的教程:
Tutorial to implement Staggered Grid View :
- Staggered Grid View
- Pinterest Masonry layout Staggered Grid View
这篇关于Android-Gridlayout和交错Gridlayout之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!