Kreshnik Kreshnik - 1 year ago 117
Android Question

ExpandableListView, how to set the child height?

I'm trying to set the ExpandableListView item (

) height. Can it be set via xml (I don't need the divider height):


or it should be used this method, by manipulating the convertView:

public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
ViewGroup parent) { ... }

Thanks in advance.

Answer Source

ListView child views can be different heights, so we don't set a one-size-fits all height in the ListView's xml. Rather you can set a specific height in each of the different convertView xml's that you are inflating.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download