Как создать список кнопок один за другим в нескольких строках? Я сделал это:
LinearLayout layout = (LinearLayout) findViewById(R.id.linear_layout_tags);
for (int i = 1; i < 10; i++) {
Button btnTag = new Button(this);
btnTag.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
btnTag.setText("Button " + i);
btnTag.setId(i);
layout.addView(btnTag);
((Button) findViewById(i)).setOnClickListener(this);
}
и получил только одну строку:
Как перейти к следующей строке программно?