WEB开发网
开发学院手机开发Android 开发 Android ExpandableListActivity 使用 阅读

Android ExpandableListActivity 使用

 2010-05-29 06:02:00 来源:WEB开发网   
核心提示:public int getGroupCount() {// TODO Auto-generated method stubreturn group.size();}@Overridepublic long getGroupId(int arg0) {// TODO Auto-generated method stub

public int getGroupCount() {

// TODO Auto-generated method stub

return group.size();

}

@Override

public long getGroupId(int arg0) {

// TODO Auto-generated method stub

return arg0;

}

@Override

public View getGroupView(int arg0, boolean arg1, View arg2,

ViewGroup arg3) {

// TODO Auto-generated method stub

return getGroupViewStub(getGroup(arg0).toString());

}

public TextView getGroupViewStub(String s) {

// Layout parameters for the ExpandableListView

AbsListView.LayoutParams lp = new AbsListView.LayoutParams(

ViewGroup.LayoutParams.FILL_PARENT, 64);

TextView text = new TextView(activity);

text.setLayoutParams(lp);

text.setTextSize(20);

text.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);

text.setPadding(36, 0, 0, 0);

text.setText(s);

return text;

}

@Override

public int getGroupCount() {

// TODO Auto-generated method stub

return group.size();

}

@Override

public long getGroupId(int arg0) {

// TODO Auto-generated method stub

return arg0;

}

@Override

public View getGroupView(int arg0, boolean arg1, View arg2,

ViewGroup arg3) {

// TODO Auto-generated method stub

return getGroupViewStub(getGroup(arg0).toString());

}

public TextView getGroupViewStub(String s) {

// Layout parameters for the ExpandableListView

AbsListView.LayoutParams lp = new AbsListView.LayoutParams(

ViewGroup.LayoutParams.FILL_PARENT, 64);

TextView text = new TextView(activity);

text.setLayoutParams(lp);

text.setTextSize(20);

上一页  1 2 3 4 5 6 7  下一页

Tags:Android ExpandableListActivity 使用

编辑录入:coldstar [复制链接] [打 印]
赞助商链接