Skip to content

Instantly share code, notes, and snippets.

@leonguyen
Last active December 15, 2015 21:28
Show Gist options
  • Select an option

  • Save leonguyen/5325424 to your computer and use it in GitHub Desktop.

Select an option

Save leonguyen/5325424 to your computer and use it in GitHub Desktop.
Android Lab: Linear Layout - Quiz - Defining an XML Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp" >
<TextView
android:id="@+id/textView01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Question"
android:textSize="20dp" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/radioButton01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Answer 1" />
<RadioButton
android:id="@+id/radioButton02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Answer 2" />
<RadioButton
android:id="@+id/radioButton03"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Answer 3" />
<RadioButton
android:id="@+id/radioButton04"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Answer 4" />
</RadioGroup>
<Button
android:id="@+id/button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Submit" />
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment