RadioButton Layout
<p>I am trying to make a RadioGroup with several RadioButtons. The first RadioButton is defined in an xml-File:</p>

<pre><code>&lt;RadioGroup
        android:id="@+id/radioGroup1"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true" &gt;

        &lt;RadioButton
            android:id="@+id/radioButtonFirst"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="20dp"
            android:gravity="center" /&gt;


    &lt;/RadioGroup&gt;
</code></pre>

<p>The rest can only be added during runtime because the number of needed RadioButtons can vary. </p>

<pre><code>RadioButton rbNext = new RadioButton(this);
        RelativeLayout.LayoutParams paramsRb = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        paramsRb.addRule(RelativeLayout.BELOW, rbFirst.getId());
        paramsRb.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        paramsRb.addRule(RelativeLayout.ALIGN_BOTTOM, ivNext.getId());
        paramsRb.setMargins(0, 0, 20, 0);

        rbNext.setLayoutParams(paramsRb);
        rbNext.setGravity(Gravity.CENTER);

        rbNext.setId(i*10+1);
</code></pre>

<p>Creating and adding the RadioButtons works perfectly but how can I distribute the RadioButtons over the whole width of the RadioGroup?</p>
