[英]Android: Layout used by wechat
In WeChat, it uses white sections for different things as you can see in below image there are three white sections in it and each item is separated by a black line: 在微信中,它为不同的事物使用白色部分,如您在下图中看到的,其中有三个白色部分,每个项目用黑线分隔:
I can suspect this is not a ListView as one might think in first glance. 我可以怀疑这不是一个ListView,因为乍一看可能会这样。
Question: Does anyone know is this some built-in component that can be used or how to go about creating similar sections ? 问题:有谁知道这是可以使用的内置组件,还是如何创建类似的部分?
I would say a linearlayout inside a scrollview with your custom listview and custom adapter is the most straightforward solution. 我想说的是,带有自定义列表视图和自定义适配器的滚动视图内部的linearlayout是最简单的解决方案。
Each time the view is inflated you check the shared preference and fill in the info accordingly in your adapter. 每次视图放大时,您都检查共享的首选项,并在适配器中相应地填写信息。 And on item click you open corresponding fragment/activity that do something.
然后在项目上单击以打开相应的片段/活动,该片段/活动可以执行某些操作。 Then you issue a callback to refresh this settings view.
然后,发出回调以刷新此设置视图。
Might not be the most elegant way to do it. 可能不是最优雅的方法。 But I think this one is easy and clear.
但是我认为这很容易理解。
I guess its a preferences activity/fragment but you can create it with a listview, linearlayouts or a combination of a scrollview and a linearlayout. 我猜它是一个首选项活动/片段,但您可以使用列表视图,线性布局或滚动视图和线性布局的组合来创建它。 You have too many solutions ;)
您有太多解决方案;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.