【问题标题】:How to know is ExpandableListView parent item expanded?如何知道 ExpandableListView 父项是否展开?
【发布时间】:2014-06-03 19:01:20
【问题描述】:

如何知道 ExpandableListView 父项是否展开?我正在“不通常”实现带有按钮的 ExpandableList ,这将展开\折叠父项。而且我没有看到任何布尔方法可以判断此父项是否已扩展。

【问题讨论】:

    标签: android expandablelistview


    【解决方案1】:

    您可以在 ExpandableListAdapter 的任一 getGroupView 中获得展开/折叠状态:

    getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent)
    

    或者在 ExpandableListView 调用 isGroupExpanded()

    boolean isGroupExpanded(int groupPosition)
    

    【讨论】:

    • 谢谢!这对我有帮助
    • 如果对您有帮助,请采纳正确答案:)
    猜你喜欢
    • 1970-01-01
    • 2015-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多