[英]How to add same layout multiple times during runtime;
I want add issue layout multiple times during run time to an Linear layout I am using below code but layout coming only one time on the screen.please help i am designing e mail like app.based number of emails layout number also changes during run-time please help me. 我想在运行时将问题版式多次添加到线性版式中,我正在使用以下代码,但版式仅在屏幕上出现一次。请帮助我设计类似app的电子邮件。基于电子邮件的数量版式号在运行时也会更改-时间请帮帮我。
for (int i=10;i<14;i++) {
LinearLayout lay = (LinearLayout) findViewById(R.id.veticaltoinsert);
View child = getLayoutInflater().inflate(R.layout.issuelayout, null);
child.setId(i);
lay.addView(child);
}
You need a listview or recyclerview here. 您在这里需要一个listview或recyclerview。 Using them you can define layout for a single item and can repeat it using adapters.
使用它们,您可以定义单个项目的布局,并可以使用适配器重复该布局。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.