How can I completely hide the groupIndicator of an ExpandableListView?

前端 未结 3 850
走了就别回头了
走了就别回头了 2020-12-08 18:31

I want to completely hide the groupIndicator in a custom ExpandableListView.

The example provided here did not seem to work.

It suggests making a selector an

相关标签:
3条回答
  • 2020-12-08 18:46

    You can try this code

    listView = (ExpandableListView) view.findViewById(R.id.listView);

    listView.setGroupIndicator(null);
    
    
    listView.setChildIndicator(null);
    
    0 讨论(0)
  • 2020-12-08 18:51

    I had the same problem and this solveed my issue. In your Listview's adapter add the following to the getGroupView.

    if (groupPosition == 0) {
         convertView = layoutInflater.inflate(R.layout.blank_layout, null);
    
    } else {
        convertView = layoutInflater.inflate(R.layout.group_indicator_cell,null);
    }
    

    This will blank the 0th groupof the list.

    Where blank layout is a layout with some view inside having layout_height=0dp. It works!

    0 讨论(0)
  • 2020-12-08 18:58

    Have you tried changing ExpandableListView's attribute android:groupIndicator="@null"?

    0 讨论(0)
提交回复
热议问题