n级可扩展Listview

时间:2012-10-22 11:21:03

标签: android

如何显示n级可扩展列表视图android,我只获得3级可扩展的示例。

参考:link

请指导或分享我在Android中的多级可扩展显示器的合适示例。

谢谢,

1 个答案:

答案 0 :(得分:8)

根据example

   public View getChildView(int groupPosition, int childPosition,

                   boolean isLastChild, View convertView, ViewGroup parent) {

             CustExpListview SecondLevelexplv = new CustExpListview(Vincent_ThreeelevellistActivity.this);

             SecondLevelexplv.setAdapter(new SecondLevelAdapter());

             SecondLevelexplv.setGroupIndicator(null);

             return SecondLevelexplv;

      }

此处getChildView方法通过CustExpListview类创建新适配器,并将sets设置为适配器。
与创建新BaseExpandableListAdapter类并将其设置为CustExpListviewgetChildView方法的方式相同。