2
A
回答
0
在BaseExpandableListView子视图
@Override
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
TableLayout layout = new TableLayout(this.context);
layout.setStretchAllColumns(true);
TableRow tr1 = null;
if(groupPosition==0){
Toast.makeText(context, "text in if"+convertView, Toast.LENGTH_SHORT).show();
if(childPosition==0){
tr1 =new TableRow(this.context);
TextView tv = new TextView(this.context);
tv.setText("one");
tv.setTextColor(Color.YELLOW);
tr1.addView(tv);
layout.addView(tr1);
}
if(childPosition==1){
tr1 =new TableRow(this.context);
TextView tv = new TextView(this.context);
tv.setText("two");
tv.setTextColor(Color.YELLOW);
tr1.addView(tv);
layout.addView(tr1);
}
if (isLastChild) {
if(pos_child==0){
layout=getObj();
}
else if(pos_child==1){
TableRow tr3 =new TableRow(this.context);
TextView tv = new TextView(this.context);
tv.setText("ameta");
tr3.addView(tv);
layout.addView(tr3);
}
}
}
return layout;
}
相关问题
- 1. 如何在ExpandableListView中为子项添加不同的布局?
- 2. 将“子”或子项添加到ExpandableListView
- 3. Kotlin - 将项目添加到ExpandableListView
- 4. 如何为每个ExpandableListView子项目执行多个不同的布局,每个ExpandableListView子项目单击时
- 5. 如何将自定义布局添加到微调项目
- 6. Android:如何将动态表格布局添加到小部件?
- 7. 如何将gradle添加到子项目根项目作为依赖关系?
- 8. 将表格行添加到循环中的表格布局
- 9. 动态添加textview到表格布局
- 10. 如何以编程方式将表格行添加到表格布局?
- 11. 如何将ImageView添加到根布局?
- 12. 如何将页脚添加到布局?
- 13. 以编程方式将线性布局项添加到网格布局
- 14. 如何将画布中的图像添加到expandablelistview(组)
- 15. 如何将项目原子添加到memcached的列表(在Python)
- 16. 以编程方式将项目添加到相对布局
- 17. 如何将布局添加到另一个布局的顶部?
- 18. 如何将布局添加到android中的布局
- 19. 动态添加不同布局的项目到列表视图
- 20. 将子项添加到ExpandableListView的特定标题
- 21. 如何将此表格布局更改为CSS布局?
- 22. 如何添加布局到vaadin中的表格组件?
- 23. 如何从JSONARRAY数据动态添加行到表格布局?
- 24. 如何在Android中将网格视图添加到选项卡布局
- 25. 如何将QLPreviewController作为子视图添加到目标中C
- 26. 将视图添加到表格布局的底部
- 27. 将RelativeLayout子项添加到父布局中动态地不起作用
- 28. 将项目添加到微调不同布局中不起作用
- 29. Bootstrap - 列表项目的网格布局
- 30. 将画布添加到相对布局
http://stackoverflow.com/questions/8891006/populating-a-list-view-from-another-list-view/ 8891240#8891240检查我给出的这个问题的答案。 – Sameer 2012-01-17 12:40:17
这个doesent有一个具有数组的布局的子视图 – 2012-01-17 13:24:34