Android XML RadioGroup,具有左右对齐的文本。

问题描述 投票:0回答:1

我是一个相当新的Android和想知道我将如何创建一个无线电组,如下图所示。

enter image description here

这是我目前拥有的XML。

    <RadioGroup
        android:id="@+id/myRadioGroup"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:checkedButton="@+id/sound"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView6">

        <RadioButton
            android:id="@+id/sound"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Basic" />

        <RadioButton
            android:id="@+id/vibration"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Pro" />

        <RadioButton
            android:id="@+id/silent"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Elite" />

    </RadioGroup>

我不太确定如何处理...,或者我想可能使用下划线,但无论如何,我不知道如何实现价格右对齐,文本左对齐。

android android-studio kotlin android-xml
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.