2013-08-22 27 views
-1

如何ExpandListView头添加到子列表这样如何头部添加到子列表中ExpandListVie

AvailableTasks  =============  Parent 
TaskNo TaskName Status 
----------------------------- 
    1  read  progress  | 
-----------------------------  | 
    2  listen pending  | Childs 
-----------------------------  | 
    3  walking started  | 
-----------------------------  | 

迫切需要任何帮助,在你getChildrenCount认识

+0

你尝试添加headerview到你的列表? 如果可能的话,把你的代码,以便我们可以找出究竟需要什么 – Shrikant

回答

0

你增加1

@Override 
public int getChildrenCount(int groupPosition) { 
    return "your children group count" + 1; 
} 

和getChildView您检查组的第一个孩子,回到你的小组的头就像

:你喜欢组的头
@Override 
public View getChildView(int groupPosition, final int childPosition, 
     boolean isLastChild, View convertView, ViewGroup parent) { 
    if(childPosition == 0){ 
     return "your header of group view"; 
    } 
    // your original code here, note that, the childPosition is increased to 1 
} 

希望得到这个帮助。