私は3つのラジオボタンを持っていて、それらを画面全体に均等に配置したいと思います。 android:layout_weight="1"
を使用すると、ボタンが画面全体に引き伸ばされます。だから私はどのように同じ大きさのスペースをそれぞれの画面サイズの異なるスケールの間にあるでしょうか?Androidでラジオボタンを均等に配置する方法は?
<RadioGroup
android:id="@+id/auton_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:layout_below="@id/clear_fields"
>
<RadioButton
android:id="@+id/auton_radio_1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/auton_col"
android:layout_weight="1"
/>
<!-- android:layout_marginRight="380dp" -->
<RadioButton
android:id="@+id/auton_radio_2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/auton_col"
android:layout_weight="1"
/>
<RadioButton
android:id="@+id/auton_radio_3"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@drawable/auton_col"
android:layout_weight="1"
/>
</RadioGroup>
おかげで、それは、仕事しました何らかの理由で 'layout_weight'パラメータが' RadioButtons'を2倍長くします。 http://i.imgur.com/7PZfm1j.png 通常、幅の半分に過ぎません。 – rasen58
あなたは 'auton_co1'にスケール可能なビットマップを作ってください。回答はrasen58 @例 –
で編集された 'アンドロイド設定:素晴らしいです0dp' – Henry