Почему вы положили в него LinearLayout?Я думаю, что вы должны вместо этого обернуть кнопки в LinearLayout
Редактировать:
Вы можете использовать RadioRealButtonGroup для группировки кнопок, вот пример кода
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<!-- First Row -->
<co.ceryle.radiorealbutton.RadioRealButtonGroup
android:id="@+id/radioRealButtonGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:rrbg_animateDrawables_enter="overshoot"
app:rrbg_animateTexts_enter="overshoot"
app:rrbg_dividerColor="@android:color/black"
app:rrbg_dividerSize="1dp"
app:rrbg_radius="10dp"
app:rrbg_selectorColor="@android:color/holo_red_dark"
app:rrbg_selectorSize="6dp">
<co.ceryle.radiorealbutton.RadioRealButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rrb_drawable="@mipmap/ic_launcher"
app:rrb_drawableHeight="36dp"
app:rrb_drawablePadding="8dp"
app:rrb_drawableWidth="36dp"
app:rrb_ripple="true"
app:rrb_rippleColor="@android:color/black"
app:rrb_text="Button 1"
app:rrb_textColor="@android:color/black" />
<co.ceryle.radiorealbutton.RadioRealButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rrb_drawable="@mipmap/ic_launcher"
app:rrb_drawableGravity="right"
app:rrb_drawableHeight="36dp"
app:rrb_drawablePadding="8dp"
app:rrb_drawableWidth="36dp"
app:rrb_ripple="true"
app:rrb_rippleColor="@android:color/black"
app:rrb_text="Button 2"
app:rrb_textColor="@android:color/black" />
<co.ceryle.radiorealbutton.RadioRealButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rrb_drawable="@mipmap/ic_launcher"
app:rrb_drawableGravity="right"
app:rrb_drawableHeight="36dp"
app:rrb_drawablePadding="8dp"
app:rrb_drawableWidth="36dp"
app:rrb_ripple="true"
app:rrb_rippleColor="@android:color/black"
app:rrb_text="Button 2"
app:rrb_textColor="@android:color/black" />
</co.ceryle.radiorealbutton.RadioRealButtonGroup>
<!-- Second Row -->
<co.ceryle.radiorealbutton.RadioRealButtonGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/radioRealButtonGroup"
app:rrbg_animateDrawables_enter="overshoot"
app:rrbg_animateTexts_enter="overshoot"
app:rrbg_dividerColor="@android:color/black"
app:rrbg_dividerSize="1dp"
app:rrbg_radius="10dp"
app:rrbg_selectorColor="@android:color/holo_red_dark"
app:rrbg_selectorSize="6dp">
<co.ceryle.radiorealbutton.RadioRealButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rrb_drawable="@mipmap/ic_launcher"
app:rrb_drawableHeight="36dp"
app:rrb_drawablePadding="8dp"
app:rrb_drawableWidth="36dp"
app:rrb_ripple="true"
app:rrb_rippleColor="@android:color/black"
app:rrb_text="Button 1"
app:rrb_textColor="@android:color/black" />
<co.ceryle.radiorealbutton.RadioRealButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:rrb_drawable="@mipmap/ic_launcher"
app:rrb_drawableGravity="right"
app:rrb_drawableHeight="36dp"
app:rrb_drawablePadding="8dp"
app:rrb_drawableWidth="36dp"
app:rrb_ripple="true"
app:rrb_rippleColor="@android:color/black"
app:rrb_text="Button 2"
app:rrb_textColor="@android:color/black" />
</co.ceryle.radiorealbutton.RadioRealButtonGroup>
</LinearLayout>
Если эторешил ваш вопрос, пожалуйста, отметьте этот ответ