Example using Relative Layout for Android to make a quiz question

When I was browsing Google to find an example of a Relative Layout for my Android application to make a quiz question I could not find one. Not too many sample code of the Relative Layout for Android. Here is the layout code I did. I have not tested it filled with multilines of text but none the less it will be good starting layout.

Relative Layout Example




 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<RelativeLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/relativeLayout1">
<TextView
android:text="Question"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/question" />
<TextView
android:text="Answer1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/textView1"
android:layout_toRightOf="@+id/radioGroup1"
android:paddingTop="10dp"
android:paddingLeft="15dp"
android:layout_below="@+id/question" />
<TextView
android:text="Answer2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:layout_toRightOf="@+id/radioGroup1"
android:layout_below="@+id/textView1"
android:paddingTop="15dp"
android:paddingLeft="15dp" />
<TextView
android:text="Answer3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/textView3"
android:layout_toRightOf="@+id/radioGroup1"
android:layout_below="@+id/textView2"
android:paddingTop="20dp"
android:paddingLeft="15dp" />
<TextView
android:text="Answer4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/textView4"
android:layout_toRightOf="@+id/radioGroup1"
android:layout_below="@+id/textView3"
android:paddingTop="20dp"
android:paddingLeft="15dp" />
<RadioGroup
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/question"
android:id="@+id/radioGroup1"
android:width="30dp"
android:height="100dp">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="A"
android:id="@+id/radioButton1" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B"
android:id="@+id/radioButton2"
android:layout_below="@id/radioButton1" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="C"
android:id="@+id/radioButton3"
android:layout_below="@id/radioButton2" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="D"
android:id="@+id/radioButton3"
android:layout_below="@id/radioButton2" />
</RadioGroup>
</RelativeLayout>
<Button
android:text="Submit Answer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/button1" />
</LinearLayout>

Graveyard Database Logo

Has everything you want to know about grave yards. Plus has many celebrites and world leaders graves. Pssst it is my other site

Google + Profile
Check out Android Photo Mapping, its a app/site I been working on

  • wholesale nfl jerseys
  • wholesale nfl jerseys china
  • wholesale sports jerseys