Closed androidwanderer closed 6 years ago
SingleSelectToggleGroup
does not support layout_weight
attribute. But you can use tbgChildSpacing="auto"
to layout each button with equal margin.
For example,
<com.nex3z.togglebuttongroup.SingleSelectToggleGroup
android:id="@+id/group_choices"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tbgChildSpacing="auto"
app:tbgCheckedButton="@+id/choice_a">
<com.nex3z.togglebuttongroup.button.CircularToggle
android:id="@+id/choice_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="A"/>
<!--...-->
<com.nex3z.togglebuttongroup.button.CircularToggle
android:id="@+id/choice_d"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="D"/>
</com.nex3z.togglebuttongroup.SingleSelectToggleGroup>
I am trying to get the radio buttons to fill the width of the screen equally using layout_width="0dp" and layout_weight="1". Unfortunately, this is making the Radio buttons not show. Is there a different way to accomplish this in the library? This is the sample XML I am using.
`<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity">
`