Wednesday 6 May 2020

radio button in android studio

                     Multi radio button in android studio with example 

                   <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:orientation="vertical">

                             <TextView
                              android:layout_width="match_parent"
                               android:layout_height="wrap_content"
                               android:layout_gravity="center"
                                android:textSize="@dimen/_16sdp"
                                android:textStyle="bold"
                                android:textColor="@color/colorPrimary"
                                android:text="Who are you here to see today?" />


                            <RadioGroup
                                android:layout_marginTop="@dimen/_10sdp"
                                android:id="@+id/radioGroup"
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content"
                                android:orientation="horizontal">

                                <RadioButton
                                    android:id="@+id/radioButton1"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Dr. "
                                    android:textSize="18sp"/>

                                <RadioButton
                                    android:id="@+id/radioButton2"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text=" Therapist."
                                    android:textSize="18sp"/>

                                <RadioButton
                                    android:id="@+id/radioButton3"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text=" Or Both"
                                    android:textSize="18sp"/>
                            </RadioGroup>

                            </LinearLayout>

No comments:

Post a Comment