如何将复选框放在屏幕的右侧

fis*_*h40 0 xml android android-emulator

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:orientation="horizontal">

    <TextView
        android:id="@+id/groups_massegesTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="TextView"
        android:layout_marginBottom="20dp"
        android:layout_marginTop="20dp"
        android:layout_marginLeft="10dp"
        android:textColor="@color/list_text_color" />

    <CheckBox
        android:id="@+id/groups_massegescheckBox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/checkbox_background"
        android:button="@drawable/checkbox"
        android:focusable="false"
        android:layout_marginBottom="20dp"
        android:layout_marginTop="20dp"
        android:layout_marginRight="5dp"
        android:layout_gravity="right"
        />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我正在使用linearlayout,我想在屏幕右侧设置复选框.我不想使用relativelayout.在linearlayout中有没有办法做到这一点.复选框始终位于textView的右侧.

Lal*_*ani 5

应用于android:layout_weight="1"TextView.