I want to use MaterialButtonToggleGroup
with 2 MaterialButton
. I want to display them with same width inside MaterialButtonToggleGroup
If I use match_parent
then only one button will be displayed and if I use wrap_content
they displayed in the middle.
Below is the current output
Below is my code :-
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/toggle_button_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:gravity="center"
app:checkedButton="@id/btn_login"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:singleSelection="true">
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_login"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_register"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Register" />
</com.google.android.material.button.MaterialButtonToggleGroup>```
Please help. Thanks