开发者

Android Radio Button Text (Left Justification)

开发者 https://www.devze.com 2023-02-21 12:15 出处:网络
I have some radio buttons (in both vertical and horizontal orientation) and I want to text jusify the android:text=\"1\", android:text=\"2\",android:text=\"3\", and android:text=\"4\" of the respectiv

I have some radio buttons (in both vertical and horizontal orientation) and I want to text jusify the android:text="1", android:text="2", android:text="3", and android:text="4" of the respective radio buttons to the left (next to the radio button). I have not been able to find a solution to setting up the LinearLayout to accomplish this. Any help would be appreciated. My xml file is:

<LinearLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   <RadioGroup
      android:id="@+id/Group01"
      android:layout_weight="1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">
      <RadioButton
         android:id="@+id/rb01"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="1" />
      <RadioButton
         android:id="@+id/rb02"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="2" />
   </RadioGroup>
   <RadioGroup
      android:id="@+id/Group02"
      android:l开发者_运维问答ayout_weight="1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">
      <RadioButton
         android:id="@+id/rb03"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="3" />
      <RadioButton
         android:id="@+id/rb04"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="4" />
   </RadioGroup>
</LinearLayout>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号