隐藏 ListView 标题/隐藏列表中的单个分隔符
我发现这个在ListView中隐藏页脚视图?。正如 Yoni 正确指出的那样,您可以通过将 ListView
中的标题包装到内部 FrameLayout
和 setVisibility()
中来隐藏该标题。 >查看到View.GONE
。这对我来说几乎完美,但是: 由于 FrameLayout
仍然存在,ListView
将两个分隔线添加到显示的列表中。它看起来像是一个高度为两个分隔板的分隔板。有没有办法隐藏 ListView 的单个分隔线?也许可以将分隔线的颜色更改为背景,这对我来说也很好。还有其他完整的想法吗?完美的!
请帮我。我不想再花两个小时反复试验。
多谢!
I found this Hide footer view in ListView?. As Yoni poited out correctly, you can hide a header in a ListView
by wrapping it into a FrameLayout
and setVisibility()
of the inner View
to View.GONE
. This works almost perfect for me, BUT:
As the FrameLayout
still exists, the ListView
adds two dividers to the displayed list. It seems like a single divider with a height of two dividers. Is there a way to hide a single divider of a ListView
? Maybe it's possible to change the divider's color to the background, that would be fine for me, too. Any complete other ideas? Perfect!
Please help me. I'm not keen on spending two more hours of trial and error.
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
除了隐藏或显示页眉或页脚之外,还可以使用以下功能:
Together with hiding or showing your header or footer, use these functions:
您可以使用 xml 属性来隐藏 ListView 中页眉和页脚的分隔线
you can use xml attributes to hide divider for header and footer in ListView
您可以像这样更改分隔线颜色:
you can change the dividers color like this:
对于禁用分频器:
For disable divider: