简体   繁体   English

多列listview布局

[英]Multi column listview layout

How to do a layout like this? 怎么做这样的布局? I currently use a listActivity and I need the same experience with this kind of layout. 我目前使用listActivity,我需要与这种布局相同的经验。 在此输入图像描述

You can use Staggered Grid View library. 您可以使用交错网格视图库。 Also check and Quilt View . 还要检查和被子视图 This is what you need. 这就是你需要的。

To get this effect, you should create two list views and link the scrolls of both lists. 要获得此效果,您应创建两个列表视图并链接两个列表的滚动。

Define a OnScrollListener on both listviews and when "onScroll()", move programatically the other list. 在两个列表视图上定义OnScrollListener,当“onScroll()”时,以编程方式移动另一个列表。 I think if all images are cached you shouldn't have delays. 我想如果所有图像都被缓存,你就不应该有延迟。

You can use Staggered Grid View library. 您可以使用交错网格视图库。 But there you need to mention height of each image pragmatically to set height of list view. 但是你需要务实地提到每个图像的高度来设置列表视图的高度。 Else when you scroll to end and come back to top, the alignment of images on top will get disturbed 另外,当您滚动到结束并返回顶部时,顶部图像的对齐将受到干扰

你必须使用GridView你可以参考这个这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM