Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/06/2011, 13:32
Avatar de zero_master
zero_master
 
Fecha de Ingreso: junio-2011
Ubicación: Leon, Gto
Mensajes: 290
Antigüedad: 12 años, 10 meses
Puntos: 74
Respuesta: como formar un RadioGroup personalizado

Mira encontré este código espero te sirva es una función para crear radiobuttons en un radiogroup:
Código:
private void createRadioButton() {
    final RadioButton[] rb = new RadioButton[5];
    RadioGroup rg = new RadioGroup(this); //create the RadioGroup
    rg.setOrientation(RadioGroup.HORIZONTAL);//or RadioGroup.VERTICAL
    for(int i=0; i<5; i++){
        rb[i]  = new RadioButton(this);
        rg.addView(rb[i]); //the RadioButtons are added to the radioGroup instead of the layout
        rb[i].setText("Test");
    }
    ll.addView(rg);//you add the whole RadioGroup to the layout
    ll.addView(submit); 
    submit.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            for(int i = 0; i < 5; i++) { 
                rg.removeView(rb[i]);//now the RadioButtons are in the RadioGroup
            }  
            ll.removeView(submit);
            Questions();
        }
    });   
}