展开列表时更改 ExpandedListView 中的文本颜色
我有一个展开的列表视图,我想在展开特定组时更改组的文本颜色。我尝试了很多方法但无法找到解决方案。请告诉我是否有任何解决方案
I have a expandedlistview and I want to change the textcolor of group when the particular group is expanded. I tried many things but not able to find solution.Please let me know if there is any solution for this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您使用的适配器中,您应该重写
getGroupView()
方法。您获得的参数之一是 isExpanded 布尔值。只需使用该值来决定设置相关文本视图的颜色。这是一个例子:In the adapter you're using you should be overriding the
getGroupView()
method. One of the parameters you get is anisExpanded
boolean value. Just use that value to decide what color to set the textview in question. Here is an example:这是代码:
Here is code :