多个按钮中的字符串列表

时间:2013-10-30 10:15:38

标签: android list button

我有一个字符串列表(视频标签),我想在一个按钮中显示每个字符串(与您希望为多个用户发送文本时相同),当我点击每个时,该框的操作就会发生。我看了看:

https://github.com/kpbird/chips-edittext-library

它在一个框中生成每个字符串,但最后我无权访问特定项目onclick。

有没有人有什么建议使用或如何制作?!

1 个答案:

答案 0 :(得分:0)

读出字符串数组 以编程方式添加一个按钮,其中包含每个文本 字符串,例如LinearLayout。

伪代码:

ArrayList<string> list = getResources.array("id");

LinearLayout l = (Linearlayout) findViewById(R.id.linearlayout);
foreach(String s in list)
{
   l.addView(new Button(s));
}

类似的东西。