Android ExpandableListActivity 使用
2010-05-29 06:02:00 来源:WEB开发网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);
Tags:Android ExpandableListActivity 使用
编辑录入:coldstar [复制链接] [打 印]更多精彩
赞助商链接