Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Re: Criar botões dinamicamente

Jean,

Você pode fazer algo assim:

final LinearLayout form = (LinearLayout)findViewById(R.id.form);
        form.setOrientation(LinearLayout.VERTICAL);
        for(int i=0; i<5; i++){
            final Button b = new Button(MainActivity.this);
            b.setText("Botao"+i);
            form.addView(b);
        } 

Estou te enviando um exemplo.  Não sei se é bem o que você quer, mas pode te ajudar.
Basta você adaptar do jeito que você quer.

Abraços
 
           


2013/12/6 Jean Semolini <jeansemolini@gmail.com>
Andre Souza, eu consigo colocar mais de um botão por linha usando uma ListView?

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Diego Lopes Marques
MSc. Candidate in Computer Science at PPgSC - UFRN

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário