相対的なAndroidレイアウトのラジオボタンをラジオグループ化する方法

スティーブ

ログインアクティビティにフィールド部門のラジオボタンと長年の経験が含まれているAndroidアプリを開発しています。そして、ログインアクティビティを相対レイアウトで設計したので、配置を変更せずにラジオボタンをRadioGroupしたいと思いました。私を助けてください !前もって感謝します !

`

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:text="@string/reg_view"
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editText1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/editText2"
    android:layout_below="@+id/textView1"
    android:layout_marginTop="59dp"
    android:ems="10"
    android:hint="@string/firstname"
    android:inputType="textPersonName"
    android:text="@string/edit_name" />

<EditText
    android:id="@+id/editText2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView2"
    android:layout_below="@+id/editText1"
    android:ems="10"
    android:hint="@string/lastname"
    android:inputType="textPersonName"
    android:text="@string/edit_name" />

<TextView
    android:id="@+id/textView3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/editText1"
    android:layout_alignLeft="@+id/editText1"
    android:layout_marginBottom="35dp"
    android:text="@string/name_view"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<RadioButton
    android:id="@+id/radioButton2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/textView4"
    android:layout_alignRight="@+id/textView1"
    android:text="@string/teamleader_radio" />
<RadioButton
    android:id="@+id/radioButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView4"
    android:layout_below="@+id/textView2"
    android:checked="true"
    android:text="@string/manager_radio" />
<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_toRightOf="@+id/textView5"
    android:text="@string/Registration_proceed" />

<TextView
    android:id="@+id/textView4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/radioButton1"
    android:layout_centerHorizontal="true"
    android:text="@string/years_view"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<RadioButton
    android:id="@+id/radioButton3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/textView4"
    android:layout_below="@+id/textView4"
    android:text="@string/years_check" />

<RadioButton
    android:id="@+id/radioButton4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/radioButton3"
    android:layout_alignBottom="@+id/radioButton3"
    android:layout_centerHorizontal="true"
    android:text="@string/years1_check" />

<RadioButton
    android:id="@+id/radioButton5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/radioButton4"
    android:layout_alignBottom="@+id/radioButton4"
    android:layout_alignParentRight="true"
    android:text="@string/years3_check" />

<TextView
    android:id="@+id/textView5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/radioButton3"
    android:layout_toLeftOf="@+id/radioButton4"
    android:text="@string/dept_view"
    android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/radioButton1"
    android:layout_below="@+id/editText2"
    android:text="@string/desig_view"
    android:textAppearance="?android:attr/textAppearanceMedium" />

`

パンカイ

を使用して、<RadioGroup>このようにラジオボタンをグループ化できます

<RadioGroup 
    android:id="@+id/radioGroup"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <RadioButton
        android:id="@+id/Red"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/red"
        android:textColor="@android:color/holo_red_dark" 
        android:onClick="onRadioButtonClicked" />

    <RadioButton
        android:id="@+id/Green"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/green"
        android:textColor="@android:color/holo_green_dark"
        android:onClick="onRadioButtonClicked"/>

    <RadioButton
        android:id="@+id/Blue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/blue"
        android:textColor="@android:color/holo_blue_dark"
        android:onClick="onRadioButtonClicked"/>

</RadioGroup>

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

ラジオグループ内の相対レイアウト

分類Dev

PyQT5:ラジオボタンの状態でライン編集をグレーアウトして非アクティブ化する方法

分類Dev

ラジオグループandroid内のラジオボタンの値を設定する方法

分類Dev

ラジオグループの2つの線形レイアウトのラジオボタンが機能しない

分類Dev

プログラムで相対レイアウト内にボタンのグリッドを追加する

分類Dev

相対レイアウトAndroid用のプログラムによるマージンの作成と設定

分類Dev

プログラムで作成されたラジオ ボタンをその線形レイアウトの垂直親 Android の中央に配置する

分類Dev

相対レイアウトオーバーラップボタンにアドモブを追加

分類Dev

Androidでプログラムで相対レイアウトのマージンを設定するにはどうすればよいですか?

分類Dev

Androidのラジオグループのラジオボタン間のスペースを減らす方法は?

分類Dev

ラジオボタンのレイアウトを水平にする

分類Dev

androidラジオグループ内のラジオボタンを揃える方法は?

分類Dev

ラジオボタンが列に配置されたテーブルレイアウトのラジオグループ

分類Dev

同じレイアウトの異なるリストビューでラジオボタンのチェックを外す方法。

分類Dev

ラジオグループなしでラジオボタンのチェックを外す方法は?

分類Dev

ラジオボタンの3x3グリッドをグループ化する方法は?

分類Dev

レイアウト上の単一のラジオボタンを処理する方法

分類Dev

XcodeAppleScriptアプリでラジオボタンのタイトルを取得する

分類Dev

ReactJSでラジオボタンのグループの値を取得する方法

分類Dev

画像付きのASP.Netラジオボタンをレイアウトする方法は?

分類Dev

異なるモデルの2つのラジオボタングループをバインドするAngularJS

分類Dev

数字からラジオボタンのグループを作成する方法

分類Dev

相対レイアウトでオーバーラップした画像ビューを作成する方法。

分類Dev

ボタングループにラジオボタンを追加する方法

分類Dev

ドロップダウンリストを使用してラジオボタンを論理的にグループ化する方法

分類Dev

Android相対レイアウトでマージンを設定する方法

分類Dev

Androidでボタンスタイルのラジオグループを変更する

分類Dev

ツールバーのオーバーラップ相対レイアウト

分類Dev

グーグルクラウドストレージクライアントがクラウドストレージ上の「ファイルオブジェクト」をポイントしてlxmlで使用する方法はありますか?

Related 関連記事

  1. 1

    ラジオグループ内の相対レイアウト

  2. 2

    PyQT5:ラジオボタンの状態でライン編集をグレーアウトして非アクティブ化する方法

  3. 3

    ラジオグループandroid内のラジオボタンの値を設定する方法

  4. 4

    ラジオグループの2つの線形レイアウトのラジオボタンが機能しない

  5. 5

    プログラムで相対レイアウト内にボタンのグリッドを追加する

  6. 6

    相対レイアウトAndroid用のプログラムによるマージンの作成と設定

  7. 7

    プログラムで作成されたラジオ ボタンをその線形レイアウトの垂直親 Android の中央に配置する

  8. 8

    相対レイアウトオーバーラップボタンにアドモブを追加

  9. 9

    Androidでプログラムで相対レイアウトのマージンを設定するにはどうすればよいですか?

  10. 10

    Androidのラジオグループのラジオボタン間のスペースを減らす方法は?

  11. 11

    ラジオボタンのレイアウトを水平にする

  12. 12

    androidラジオグループ内のラジオボタンを揃える方法は?

  13. 13

    ラジオボタンが列に配置されたテーブルレイアウトのラジオグループ

  14. 14

    同じレイアウトの異なるリストビューでラジオボタンのチェックを外す方法。

  15. 15

    ラジオグループなしでラジオボタンのチェックを外す方法は?

  16. 16

    ラジオボタンの3x3グリッドをグループ化する方法は?

  17. 17

    レイアウト上の単一のラジオボタンを処理する方法

  18. 18

    XcodeAppleScriptアプリでラジオボタンのタイトルを取得する

  19. 19

    ReactJSでラジオボタンのグループの値を取得する方法

  20. 20

    画像付きのASP.Netラジオボタンをレイアウトする方法は?

  21. 21

    異なるモデルの2つのラジオボタングループをバインドするAngularJS

  22. 22

    数字からラジオボタンのグループを作成する方法

  23. 23

    相対レイアウトでオーバーラップした画像ビューを作成する方法。

  24. 24

    ボタングループにラジオボタンを追加する方法

  25. 25

    ドロップダウンリストを使用してラジオボタンを論理的にグループ化する方法

  26. 26

    Android相対レイアウトでマージンを設定する方法

  27. 27

    Androidでボタンスタイルのラジオグループを変更する

  28. 28

    ツールバーのオーバーラップ相対レイアウト

  29. 29

    グーグルクラウドストレージクライアントがクラウドストレージ上の「ファイルオブジェクト」をポイントしてlxmlで使用する方法はありますか?

ホットタグ

アーカイブ