BaseExpandableListAdapter的疑问
public View getChildView(int groupPosition, int childPosition,boolean isLastChild, View convertView,ViewGroup parent)
1.convertView是代表当前显示的样子,那parent是代表什么?
public View getGroupView(int groupPosition, boolean isExpanded,View convertView, ViewGroup parent)
2.parent这个具体指什么?
3.组显示的箭头图片是否可以更换?如何更换?
4.
// 创建组/子视图 public TextView getGenericView(String s) { // Layout parameters for the ExpandableListView AbsListView.LayoutParams lp = new AbsListView.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, 40); TextView text = new TextView(a.this); text.setLayoutParams(lp); // Center the text vertically text.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); // Set the text starting position text.setPadding(36, 0, 0, 0); text.setText(s); return text; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { String string = group.get(groupPosition); LayoutInflater inflater = (LayoutInflater) a.this .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.c, null); chil c = new chil(); c.tv = (TextView) convertView.findViewById(R.id.tv2); c.tv.setText(string); return convertView; }