如何在Android中创建这种类型的Listview? [英] How do create this type of Listview in Android?

查看:58
本文介绍了如何在Android中创建这种类型的Listview?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在android中设计这种类型的布局.我如何用灰色线(如下图)连接每个列表项.我认为有一个包含列表项的列表视图,但是我不知道该如何通过此灰线连接这些列表项?

I want to design this type of layout in android. How can i connect each list items with a gray color line like below image. I think there a listview that contains the list items but i don't know about that how can i connect these list items through this gray line?

推荐答案

您不需要连接任何东西.您需要使其外观连接.

You do not need to connect anything. You need to make it look connected.

最简单的方法是确保行之间不存在填充/边距(如果您要像图片上那样分隔行,则需要使此分隔成为行布局的一部分,因此,它看起来还是分隔的,但是您正在分隔他们自己,不要使用任何listview/recycler视图分隔器或装饰器.然后,当您使用到达该行顶部和/或底部的图像时,如果一行中该图像到达底部,然后下一个图像从顶部开始,则它看起来已连接

Simplest approach would be to ensure no padding/margin between rows exists (if you want to separate rows as on the picture you need to make this separation part of your row layout, so it, again, looks separated but you are separating them yourself and not use any listview/recycler view dividers nor decorators). Then when you use image that reaches top and/or bottom of the row and if in one row this image reaches bottom and then next one starts from top, then it looks connected

其他方法是(如果您的行数有限)考虑使用ScrollView,而不是列表.我怀疑基于在tag3和tag4之间的较大点的放置方式,您的图片上可能是这种情况.这样一来,您就可以对大点的运动进行动画处理,否则对于listview来说,操作起来会更加棘手.

Other approach would be (if you got limited number of rows) to consider using ScrollView, not the list. I suspect this may be the case on your picture based on how this bigger dot between tag3 and tag4 is placed. This would allow you to i.e. animate movement of that big dot which otherwise would be much more trickier with listview.

这篇关于如何在Android中创建这种类型的Listview?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆