My XML layout in portrait is correct, however on my landscape view, some content is hidden behind my action bar.
see example below
and here is my XML Layout:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="#dimen/activity_horizontal_margin">
<LinearLayout
android:layout_width="600dp"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:orientation="vertical"
android:layout_gravity="center"
tools:context="com.example.gharrington.myapplication.NewOrderForm"
>
<TextView
android:text="Name:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/FieldLabelStyle" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/edtName"
android:singleLine="true"
android:layout_marginBottom="#dimen/activity_horizontal_margin"
android:hint="Enter Name..." />
<TextView
android:text="Meal:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/FieldLabelStyle" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spnMeal"
android:entries="#array/meals"
android:layout_marginBottom="#dimen/activity_horizontal_margin" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/radioGroupMeal"
android:layout_marginBottom="#dimen/activity_horizontal_margin">
<RadioButton
android:layout_width="#dimen/radio_button_width"
android:layout_height="wrap_content"
android:text="Sandwich"
android:checked="true"
android:id="#+id/sandwich"
/>
<RadioButton
android:layout_width="#dimen/radio_button_width"
android:layout_height="wrap_content"
android:text="Meal"
android:orientation="horizontal"
android:layout_marginLeft="#dimen/activity_vertical_margin"
android:id="#+id/meal"
/>
</RadioGroup>
<TextView
android:text="Drink:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/FieldLabelStyle" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/spnDrinks"
android:entries="#array/drinks"
android:layout_marginBottom="#dimen/activity_horizontal_margin"
/>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/radioGroupDrink"
android:layout_marginBottom="#dimen/activity_horizontal_margin"
>
<RadioButton
android:layout_width="#dimen/radio_button_width"
android:layout_height="wrap_content"
android:text="Small"
android:checked="true"
android:id="#+id/small"
/>
<RadioButton
android:layout_width="#dimen/radio_button_width"
android:layout_height="wrap_content"
android:text="Regular"
android:layout_marginLeft="#dimen/activity_vertical_margin"
android:id="#+id/medium"
/>
<RadioButton
android:layout_width="#dimen/radio_button_width"
android:layout_height="wrap_content"
android:text="Large"
android:layout_marginLeft="#dimen/activity_vertical_margin"
android:id="#+id/large"
/>
</RadioGroup>
<TextView
android:text="Notes:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/FieldLabelStyle" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/notes"
android:hint="Notes"
android:layout_marginBottom="40dp" />
<TextView
android:text="Paid:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/FieldLabelStyle" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/paidcheckBox" />
<TextView
android:text="Total:"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="#style/FieldLabelStyle"
android:layout_gravity="right"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/total"
android:text="£0.00"
android:layout_gravity="right"
style="?android:textAppearanceLarge"
android:layout_marginBottom="#dimen/activity_horizontal_margin" />
<Button
android:text="Save"
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right" />
</LinearLayout>
</ScrollView>
Im pretty sure I should not have to account for the padding at the top.
try this
android:layout_gravity="center_horizontal"
for ur linear layout
In your LinearLayout Remove
android:layout_gravity="center"
and try it
Related
I am trying to place a radio group with 3 radio buttons inside a linear layout. My aim is to choose only one RadioButton inside the RadioGroup but, it is giving me an error that there are multiple root tags. Can someone figure out how to solve this?
file.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ok"
android:id="#+id/textemail"/>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent">
<RadioButton
android:id="#+id/one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="one" />
<RadioButton
android:id="#+id/two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="two"
/>
<RadioButton
android:id="#+id/three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="three" />
</RadioGroup>
<TextView
android:id="#+id/textView1"
android:layout_below="#+id/textemail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="To:"
/>
<TextView
android:id="#+id/TextTo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="khushi"/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Comment:"
/>
<TextView
android:id="#+id/TextS3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="your comment"
/>
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="email us "
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="#+id/editText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:inputType="textMultiLine"
android:lines="10" />
<Button
android:id="#+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Send"
android:textStyle="italic"/>
</LinearLayout>
You immediately close your radiogroup:
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"/>
This should be:
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"> // Note that there is no forward slash at the end
And you are not closing the RadioGroup:
</RadioButton> <-- This should be </RadioGroup>
Your RadioButton (views) should be children of the RadioGroup(view). By closing your RadioGroup using /> you declare the RadioButton(s) and the RadioGroup as children of the LinearLayout.
The Following should work.
<?xml version="1.0" encoding="utf-8"?>
<Linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="hello"
android:id="#+id/textview"/>
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent">
<RadioButton
android:id="#+id/one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="one" />
<RadioButton
android:id="#+id/two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="two"
/>
<RadioButton
android:id="#+id/three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="three" />
</RadioButton>
</RadioGroup>
<TextView
android:id="#+id/textViewllol"
android:layout_below="#+id/textemail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hi:"
/>
<TextView
android:id="#+id/Texme"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
/>
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="comment:"
/>
<TextView
android:id="#+id/Text2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="your comments"
/>
<TextView
android:id="#+id/textView45"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ok"
/>
<EditText
android:id="#+id/editTextMessage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:lines="10" />
<Button
android:id="#+id/button4785"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="send"
/>
</LinearLayout>
Change below -
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"/>
to
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent">
<RadioButton
android:id="#+id/one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="one" />
<RadioButton
android:id="#+id/two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="two"
/>
<RadioButton
android:id="#+id/three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="three" />
</RadioGroup>
One of your Text is not in correct format change it as below -
<TextView
android:id="#+id/textView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ok:"
/>
to
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ok:"
/>
One more error -
change below -
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent">
to
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content">
You have one </Radiobutton> tag above </Radiogroup> that shouldn't be here. Just remove it to have :
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent">
<RadioButton
android:id="#+id/one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="one" />
<RadioButton
android:id="#+id/two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="two"
/>
<RadioButton
android:id="#+id/three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="three" />
</RadioGroup>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00b9e8"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin" >
<RelativeLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:background="#ffffff" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="Serch"
android:textColor="#000"
android:textSize="20sp" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/textView2"
android:layout_marginRight="32dp"
android:src="#drawable/backbutton" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#6AED83"
android:gravity="center" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="Footer"
android:textColor="#000000"
android:textSize="20sp" />
</RelativeLayout>
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="122dp"
android:text="Enter Mobile Number"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:textSize="20dp" />
<LinearLayout
android:id="#+id/layout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView1"
android:layout_marginLeft="14dp"
android:layout_marginTop="16dp"
android:background="#drawable/roundedlinearlayout3"
android:weightSum="4" >
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="#drawable/user_s_icon" />
<EditText
android:id="#+id/editText1"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:hint="Enter Mobile Number"
android:textColorHint="#0060a4" >
</EditText>
</LinearLayout>
<Button
android:id="#+id/signin"
android:layout_width="244dip"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/layout1"
android:layout_below="#+id/layout1"
android:layout_marginTop="27dp"
android:background="#drawable/rounded"
android:text="Search"
android:textColor="#ffffff"
android:textSize="10pt" />
</RelativeLayout>
This is my Xml i am Unable to set Linear layout inside text view and image button Like desire image:
This is my desire screen : below is my current screen :
i am unable to set text-view and image view on top of Linear layout
Try this way,hope this will help you to solve your problem.
Instead of using RelativeLayout use LinearLayout which can be easily done your requirement.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00b9e8"
android:orientation="vertical">
<LinearLayout
android:id="#+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:gravity="center"
android:background="#ffffff" >
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Serch"
android:textColor="#000"
android:textSize="20sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1"/>
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/backbutton" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Mobile Number"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#ffffff"
android:textSize="20dp" />
<LinearLayout
android:id="#+id/layout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textView1"
android:layout_marginTop="10dp"
android:background="#drawable/roundedlinearlayout3">
<EditText
android:id="#+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Mobile Number"
android:textColorHint="#0060a4"
android:drawableLeft="#drawable/user_s_icon">
</EditText>
</LinearLayout>
<Button
android:id="#+id/signin"
android:layout_width="244dip"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#drawable/rounded"
android:text="Search"
android:textColor="#ffffff"
android:textSize="10pt" />
</LinearLayout>
<LinearLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#6AED83"
android:gravity="center"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Footer"
android:textColor="#000000"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
I have the following RelativeLayout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<RadioGroup
<!--stuff-->
</RadioGroup>
<Spinner
android:id="#+id/colour_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/radioGroup1" />
<TextView
android:id="#+id/colourLabel"
android:text="#string/label_colour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/radioGroup1"
android:layout_toLeftOf="#+id/colour_spinner"/>
<Spinner
android:id="#+id/country_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/colour_spinner" />
<TextView
android:id="#+id/countryLabel"
android:text="#string/label_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/colour_spinner"
android:layout_toLeftOf="#+id/country_spinner"/>
<Spinner
android:id="#+id/stadium_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/country_spinner" />
<TextView
android:id="#+id/stadiumLabel"
android:text="#string/label_stadium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/country_spinner"
android:layout_toLeftOf="#+id/stadium_spinner"/>
Hopefully it's obvious what I'm trying to do here. Three spinners, each below the one before, and a label to the left of each, ideally all lined up neatly.
The result I'm getting at the moment is that only the spinners show on the screen, and I get no text labels at all. What am I doing wrong here? I suspect it's to do with my layout width/height settings?
Enclose each spinner and label inside a horizontal LinearLayout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RadioGroup
android:id="#+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<!-- stuff -->
</RadioGroup>
<LinearLayout
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/radioGroup"
android:orientation="horizontal" >
<TextView
android:id="#+id/colourLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_colour" />
<Spinner
android:id="#+id/colour_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/spinner2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/spinner1"
android:orientation="horizontal" >
<TextView
android:id="#+id/countryLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/label_country" />
<Spinner
android:id="#+id/country_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/spinner3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/spinner2"
android:orientation="horizontal" >
<TextView
android:id="#+id/stadiumLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_stadium" />
<Spinner
android:id="#+id/stadium_spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
try this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="50dip" >
</RadioGroup>
<TextView
android:id="#+id/colourLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/radioGroup1"
android:text="label_colour"
android:textColor="#android:color/white" />
<Spinner
android:id="#+id/colour_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/radioGroup1"
android:layout_toRightOf="#+id/colourLabel" />
<TextView
android:id="#+id/countryLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/colour_spinner"
android:text="label_country"
android:textColor="#android:color/white" />
<Spinner
android:id="#+id/country_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/colour_spinner"
android:layout_toRightOf="#+id/countryLabel" />
<TextView
android:id="#+id/stadiumLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/country_spinner"
android:text="label_stadium" />
<Spinner
android:id="#+id/stadium_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/country_spinner"
android:layout_toRightOf="#+id/stadiumLabel" />
</RelativeLayout>
i am doing one application in android but i have one problem in layout file
i am doing by viewFliper
here is code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="#+id/Quesiontext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="44dp"
android:text="#string/Question"
android:textSize="18sp" />
<RadioGroup
android:id="#+id/radioGroupOptions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/Quesiontext"
android:layout_marginTop="30dp" >
<RadioButton
android:id="#+id/optionOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="#string/option1" />
<RadioButton
android:id="#+id/optionTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/option2" />
<RadioButton
android:id="#+id/optionthree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/option3" />
<RadioButton
android:id="#+id/optionFour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/option4" />
</RadioGroup>
<TextView
android:id="#+id/corrertView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/radioGroupOptions"
android:layout_marginRight="48dp"
android:text="#string/correct" />
<Button
android:id="#+id/btnNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/corrertView"
android:layout_below="#+id/corrertView"
android:layout_marginTop="42dp"
android:text="#string/Next"
android:textSize="16sp" />
<Button
android:id="#+id/Btnpervious"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/btnNext"
android:layout_alignBottom="#+id/btnNext"
android:layout_alignParentLeft="true"
android:text="#string/Pervious"
android:textSize="16sp" />
<RelativeLayout
android:id="#+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ViewFlipper
android:id="#+id/ViewFlipper01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/Quesiontext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="44dp"
android:text="#string/Question"
android:textSize="18sp" />
<RadioGroup
android:id="#+id/radioGroupOptions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/Quesiontext"
android:layout_marginTop="30dp" >
<RadioButton
android:id="#+id/optionOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="#string/option1" />
<RadioButton
android:id="#+id/optionTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/option2" />
<RadioButton
android:id="#+id/optionthree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/option3" />
<RadioButton
android:id="#+id/optionFour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/option4" />
</RadioGroup>
<TextView
android:id="#+id/corrertView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/radioGroupOptions"
android:layout_marginRight="48dp"
android:text="#string/correct" />
</ViewFlipper>
</RelativeLayout>
</RelativeLayout>
i didnt get it that how i put another button into ViewFliper ..its confusion and generating error...
You haven't closed your ViewFlipper with </ViewFlipper>
Could this be what you are looking for,
android:id="#+id/layout"
You missed a "+" symbol while creating a id.
Hi i have an application, where i want to use scroll option in liner layout. Please help me i am stuck.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:orientation="vertical"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
>
<AnalogClock android:id="#+id/clock1" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageButton android:id="#+id/rssbtn" android:src="#drawable/rss"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ProgressBar android:id="#+id/progress"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<RadioGroup android:id="#+id/widget1" android:layout_width="wrap_content"
android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<RadioButton android:id="#+id/widget2"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Plain" android:checked="false" android:layout_gravity="left"
android:layout_weight="0">
</RadioButton>
<RadioButton android:id="#+id/widget3"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Serif" android:checked="true" android:layout_gravity="left"
android:layout_weight="0" android:typeface="serif">
</RadioButton>
<RadioButton android:id="#+id/widget25"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Bold" android:checked="false" android:layout_weight="0"
android:layout_gravity="left" android:textStyle="bold">
</RadioButton>
</RadioGroup>
<Spinner android:id="#+id/widget1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:drawSelectorOnTop="false" />
<TimePicker android:id="#+id/widget3" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox android:id="#+id/plain_cb" android:text="Plain"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<CheckBox android:id="#+id/serif_cb" android:text="Serif"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:typeface="serif" />
<CheckBox android:id="#+id/bold_cb" android:text="Bold"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" />
<CheckBox android:id="#+id/italic_cb" android:text="Italic"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textStyle="italic" />
<Button android:id="#+id/button1" android:text="Label"
android:layout_width="fill_parent" android:layout_height="fill_parent" />
<Button android:id="#+id/button2" android:text="Label"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:typeface="serif" />
<Button android:id="#+id/button3" android:text="Label"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:textStyle="italic" />
<DatePicker android:id="#+id/datepicker"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<EditText android:id="#+id/edittext1" android:text="EditText 1"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<EditText android:id="#+id/button2" android:text="(206)555-1212"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:typeface="serif" android:phoneNumber="true" />
<EditText android:id="#+id/password" android:text="SuperSecret"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:password="true" />
</LinearLayout>
Wrap your LinearLayout in a ScrollView at the top of the file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="fill_parent">
<LinearLayout
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:orientation="vertical"
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
>
.....
</LinearLayout>
</ScrollView>