ラジオグループにそのように見える2つのラジオボタンがあります。
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_PubAsMe"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="Self"
android:textColor="#000000" />
<RadioButton
android:id="@+id/rb_PubAsTeam"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Team"
android:textColor="#000000" />
</RadioGroup>
デフォルトでは、Androidは左揃えになりますが、これらのボタンを中央に配置したいと思います。各ボタンの重力を中央に設定しようとすると、次のようになります。
同じコードですが、この行を各ラジオボタンに追加しました
android:gravity="center"
誰かがこの問題に遭遇しましたか?ボタンをテキストとともに中央に移動するにはどうすればよいですか?
|---------(Button)Text---------|---------(Button)Text---------|