<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>
I am using linearlayout and I want set checkbox in the right of screen. I don’t want to use relativelayout. Is there a way do this in linearlayout. Checkbox is always to right of textView.
Apply
android:layout_weight="1"to the TextView.