0

如何在ChildView不影响我的基础数据和ChildView. 下面是我的ExpandableListView适配器的骨架实现:

私有类 EAdapter 扩展 CursorTreeAdapter {

public EAdapter(Cursor cursor, Context context) {
   super(cursor, context);
  }

  @Override
  protected void bindChildView(View view, Context context, Cursor cursor,
    boolean isLastChild) {

 }

  @Override
  protected void bindGroupView(View view, Context context, Cursor cursor,
    boolean isExpanded) {

 }

  ChildHolder childHolder;

  @Override
  protected View newChildView(Context context, Cursor cursor,
    boolean isLastChild, ViewGroup parent) {

  view.setTag(childHolder);
   registerForContextMenu(view);
   return view;
  }

  GroupHolder groupHolder;

  @Override
  protected View newGroupView(Context context, final Cursor cursor,
    boolean isExpanded, ViewGroup parent) {

view.setTag(groupHolder);
   return view;
  }

  @Override
  protected Cursor getChildrenCursor(Cursor groupCursor) {

 return cursor;
  }
}

任何帮助/指针将是最有帮助的。

4

1 回答 1

0

您可以在 newChildView 函数中创建为新视图加载的布局 XML。

于 2010-11-30T16:40:09.347 回答