Text Outside of viewable area - android

In my view, the text is stretching beyond the screen as seen here:
Here is the layout xml:
<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="5dp" >
<TextView
android:id="#+id/tvBasicProfileProjectName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/double_dash"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/grey"
android:orientation="horizontal"
android:weightSum="2" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="200dp"
android:layout_height="150dp"
android:contentDescription="#string/image_holder"
android:src="#drawable/nature444photo" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="2dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_basic_profile_project_status"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_projectstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/double_dash" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_basic_profile_project_type"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_projecttype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/double_dash" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_basic_profile_project_contact"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_projectcontact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/double_dash" />
</LinearLayout>
</LinearLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_project_relationships"
android:textColor="#color/white"
android:textStyle="bold" />
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:paddingTop="5dp" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dp" >
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_related_global_priorities"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_rel_global_priorities"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dp" >
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_related_regional_priority_strategies"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_related_regional_priority_strategies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dp" >
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_related_whole_system_priorities"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_related_whole_system_priorities"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingBottom="2dp" >
<TextView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_related_demonstration_priorities"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_related_demonstration_priorities"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
</TableRow>
</TableLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_geographic_whole_system"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_geographic_whole_system"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:padding="3dp"
android:text="#string/double_dash" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_project_description"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_project_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_programs"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_programs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_tnc_region"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_tnc_region"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/nature_green_header"
android:padding="3dp"
android:text="#string/label_countries"
android:textColor="#color/white"
android:textStyle="bold" />
<TextView
android:id="#+id/tv_basicprofile_countries"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:text="#string/double_dash" />
<TextView
android:id="#+id/tv_basicprofile_modified"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="3dp"
android:text="#string/double_dash"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</ScrollView>
</LinearLayout>
And, within Eclipse. this is what I see when I select the element.
Even here, the container shows to exceed the display.
Can somebody tell me what I am doing wrong here?
Thanks!
Update 1: added complete layout.
Update 2: added snapshot of layout within Eclipse.

Is there a particular reason you have used wrap_content for the width of the TableLayout and TableRows?
This is the only thing that could cause this behaviour. I think you should use match_parent.
(I haven't tested your layout, but it's the only thing that looks wrong to me).

Related

Radio group in table layout with radio buttons aligned to columns

I am developing a feedback application which should has similar layout to this screen. [1]: https://i.stack.imgur.com/xn3kh.jpg
I have designed the xml for layout.
<LinearLayout 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:background="#000"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.zankrutparmar.feedback.Frag_one">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/frag_one_title"
android:textColor="#fff"
android:textStyle="bold|italic"
android:textSize="35dp"
android:textAlignment="center"/>
<LinearLayout
android:layout_width="819dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/activity_vertical_margin"
android:layout_marginBottom="#dimen/activity_vertical_margin"
android:layout_marginEnd="#dimen/activity_vertical_margin"
android:text="Poor"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="35dp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_vertical_margin"
android:text="Average"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="35dp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_vertical_margin"
android:text="Good"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="35dp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_vertical_margin"
android:text="Very Good"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="35dp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_vertical_margin"
android:text="Excellent"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="35dp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="6">
<TextView
android:layout_width="58dp"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_vertical_margin"
android:layout_weight="1"
android:text="Theme & Decor"
android:textAlignment="center"
android:textColor="#fff"
android:textSize="25dp"
android:textStyle="bold|italic" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_vertical_margin"
android:layout_weight="5"
android:orientation="horizontal">
<RadioButton
android:id="#+id/poor1"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#drawable/custom_btn_radio_poor"
android:button="#null" />
<RadioButton
android:id="#+id/average1"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#drawable/custom_btn_radio_average"
android:button="#null" />
<RadioButton
android:id="#+id/good1"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#drawable/custom_btn_radio_good"
android:button="#null" />
<RadioButton
android:id="#+id/very1"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#drawable/custom_btn_radio_very_good"
android:button="#null" />
<RadioButton
android:id="#+id/excellent1"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#drawable/custom_btn_radio_excellent"
android:button="#null" />
</RadioGroup>
</LinearLayout>
Now whenever I want to apply margin to these radio buttons the center one remains in center and pushes all other buttons far.
I also tried the answers on this question [1]: TableLayout of radiogroup(s) with respective label(s) aligned in android
But in that layout the problem is all buttons in single row are getting selected. It means Radiogroup can't be placed in that layout.
And I have to fetch questions from a database and place them in my application.
So in Future I will have to add rows dynamically.
Any help will be very appreciated. Thank you in advance.
Okay I designed a new layout and fixed those previous issues. I am uploading that code.
<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:background="#8bae3a"
tools:context="com.zankrutparmar.feedback.Frag_two">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow
android:layout_width="match_parent"
android:layout_marginLeft="20dp"
android:layout_height="match_parent" >
<TextView
android:id="#+id/textView5"
android:layout_column="1"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#+id/textView10"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#+id/textView9"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="#+id/textView6"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="TextView" />
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<RadioGroup
android:layout_marginLeft="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:orientation="horizontal">
<RadioButton
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:padding="8dp"
android:layout_marginLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<RadioButton
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:paddingLeft="8dp"
android:layout_marginLeft="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:paddingLeft="8dp"
android:layout_marginLeft="5dp"
/>
<RadioButton
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:paddingLeft="8dp"
android:layout_marginLeft="7dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</RadioGroup>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<RadioGroup
android:layout_marginLeft="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:orientation="horizontal">
<RadioButton
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:padding="8dp"
android:layout_marginLeft="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<RadioButton
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:paddingLeft="8dp"
android:layout_marginLeft="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:paddingLeft="8dp"
android:layout_marginLeft="5dp"
/>
<RadioButton
style="#style/MyRadioButtonStyle"
android:gravity="center"
android:paddingLeft="8dp"
android:layout_marginLeft="7dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
/>
</RadioGroup>
</TableRow>
</TableLayout>

ScrollView laggs too much on scrolling android

i am using scrollview in Linearlayout , the problem is layout respond normally, as soon as i start scrolling, it laggs too much.
< LinearLayout >
< ScrollView >
< Linearlayout >..sub (LinearLayout)..< /LinearLayout >
< ScrollView>
< LinearLayout>
<?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:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:orientation="vertical"
android:background="#drawable/round_edittext"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/pddd"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/profile_user_email_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:clickable="true"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Complete Your profile"
android:textAlignment="center"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:background="#drawable/round_edittext"
android:inputType="textCapSentences"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile : "
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_mobile_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5sp"
android:background="#drawable/round_edittext"
android:inputType="number"
android:maxLength="10"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold"
/>
</LinearLayout>
<RadioButton
android:id="#+id/profile_faculty_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="20sp"
android:text="Faculty"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/profile_parents_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="10sp"
android:text="Parents"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<LinearLayout
android:id="#+id/layout_faculty_key_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="6">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<EditText
android:id="#+id/pff_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/faculty_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="#+id/proile_activity_unique_key_linearlayout_id"
>
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold"
/>
<EditText
android:id="#+id/profile_activity_school_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/profile_activity_school_key_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold"
/>
<ImageView
android:id="#+id/profile_activity_school_key_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="20sp"
android:orientation="horizontal"
>
<Spinner
android:id="#+id/activityprofile_spinner_id"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_marginLeft="50sp"
>
</Spinner>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="#+id/profile_saveinfo_id"
android:layout_width="100sp"
android:layout_height="50sp"
android:layout_gravity="center_horizontal"
android:background="#drawable/save2" />
<Button
android:id="#+id/profile_nagivate_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Navigate" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
i have used this code for my Linearlayout, As soon as i touch radioButton or edittext or i scrolldown, It start lagging alot. Im not able to understand the problem, the images i have used are small size below 100kb
I edited your code and took out about 4 LinearLayouts which were unnecessary. Please test it for performance. If it still is slow try substituting some of the remaining vertical LinearLayouts with RelativeLayouts as #IshitaShinha suggested.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/round_edittext"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/pddd"
android:orientation="vertical">
<TextView
android:id="#+id/profile_user_email_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:clickable="true"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Complete Your profile"
android:textAlignment="center"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:background="#drawable/round_edittext"
android:inputType="textCapSentences"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile : "
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profileActivity_student_mobile_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5sp"
android:background="#drawable/round_edittext"
android:inputType="number"
android:maxLength="10"
android:textColor="#000"
android:textSize="25sp"
android:textStyle="bold" />
</LinearLayout>
<RadioButton
android:id="#+id/profile_faculty_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="20sp"
android:text="Faculty"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/profile_parents_radio_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginTop="10sp"
android:text="Parents"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout
android:id="#+id/layout_faculty_key_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10sp"
android:orientation="horizontal"
android:visibility="visible"
android:weightSum="6">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/pff_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold" />
<ImageView
android:id="#+id/faculty_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="#+id/proile_activity_unique_key_linearlayout_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="0sp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Key :"
android:textColor="#000"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="#+id/profile_activity_school_key"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_weight="3"
android:background="#drawable/round_edittext"
android:inputType="text|textNoSuggestions"
android:textColor="#000"
android:textSize="30sp"
android:textStyle="bold" />
<ImageView
android:id="#+id/profile_activity_school_key_verify_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/check"
android:textColor="#000"
android:textStyle="bold" />
<ImageView
android:id="#+id/profile_activity_school_key_cancle_bt_id"
android:layout_width="0sp"
android:layout_height="50sp"
android:layout_weight="1"
android:background="#drawable/minus1"
android:textColor="#000"
android:textStyle="bold" />
</LinearLayout>
<Spinner
android:id="#+id/activityprofile_spinner_id"
android:layout_width="200sp"
android:layout_height="wrap_content"
android:layout_marginLeft="50sp"
android:layout_marginTop="20sp" />
<Button
android:id="#+id/profile_saveinfo_id"
android:layout_width="100sp"
android:layout_height="50sp"
android:layout_gravity="center_horizontal"
android:background="#drawable/save2" />
<Button
android:id="#+id/profile_nagivate_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Navigate" />
</LinearLayout>
</ScrollView>

Listview in layout which should be scrollable

I have a problem, I have a long layout so I need it will be scrollable. But I need two listview in it. I have made using linearlayout and in forcycle I add a items in it. But I have lost all functions what listview offers and I want to use them.
Do anybody knows, how looks like "events" view in facebook app? It looks like there are a lot of listviews (birthdays, events, ...) and whole view is scrollable. I need something like this.
Thank you for ansver. :)
EDIT: There is my xml (There are two LinearLayouts: #+id/passengersList and #+id/discussionList and I want use ListViews instead):
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/travelDetailScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#f8ffe1"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="#+id/travelId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<RelativeLayout
android:id="#+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/waypoints"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:textColor="#333333"
android:textSize="16sp" />
<ImageView
android:id="#+id/travelMap"
android:layout_width="70dp"
android:layout_height="70dp"
android:paddingLeft="0dp"
android:paddingTop="0dp"
android:paddingRight="8dp"
android:layout_below="#+id/waypoints"
android:contentDescription="#string/travel_detail" />
<TextView
android:id="#+id/driver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/waypoints"
android:layout_toRightOf="#+id/travelMap"
android:textColor="#333333"
android:textSize="14sp" />
<TextView
android:id="#+id/car"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/driver"
android:layout_toRightOf="#+id/travelMap"
android:paddingBottom="10dp"
android:textColor="#333333"
android:textSize="14sp" />
<TextView
android:id="#+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/waypoints"
android:textColor="#aaaaaa"
android:layout_alignParentRight="true"
android:textSize="14sp" />
<TextView
android:id="#+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/date"
android:layout_alignParentRight="true"
android:textColor="#aaaaaa"
android:textSize="14sp" />
<ImageView
android:id="#+id/icon_price"
android:layout_below="#+id/car"
android:layout_toRightOf="#+id/travelMap"
android:layout_width="20dp"
android:layout_height="20dp"
android:paddingLeft="0dp"
android:paddingTop="0dp"
android:paddingRight="6dp"
android:contentDescription="#string/travel_price" />
<TextView
android:id="#+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/car"
android:layout_toRightOf="#+id/icon_price"
android:paddingRight="40dp"
android:textColor="#333333"
android:textSize="14sp" />
<ImageView
android:id="#+id/icon_seats"
android:layout_below="#+id/car"
android:layout_toRightOf="#+id/price"
android:layout_gravity="center|center_vertical"
android:layout_width="20dp"
android:layout_height="20dp"
android:paddingLeft="0dp"
android:paddingTop="0dp"
android:paddingRight="6dp"
android:contentDescription="#string/travel_seats" />
<TextView
android:id="#+id/seats"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/car"
android:layout_toRightOf="#+id/icon_seats"
android:layout_gravity="center|center_vertical"
android:paddingBottom="10dp"
android:textColor="#333333"
android:textSize="14sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/header"
android:layout_centerHorizontal="true" >
<RelativeLayout
android:id="#+id/buttonsLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="#+id/btn_travel_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/travel_login" />
<Button
android:id="#+id/btn_travel_logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/travel_logout"
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/buttonsRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="8dp"
android:layout_toRightOf="#+id/buttonsLeft" >
<Button
android:id="#+id/btn_travel_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/travel_edit"
android:visibility="gone" />
<Button
android:id="#+id/btn_travel_watch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/travel_watch"
android:visibility="gone" />
<Button
android:id="#+id/btn_travel_unwatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/travel_unwatch"
android:visibility="gone" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/buttons"
android:paddingTop="10dp">
<TextView
android:id="#+id/driverTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|center_vertical"
android:paddingBottom="2dp"
android:textColor="#333333"
android:textSize="14sp"
android:text="#string/driver_title" />
<RelativeLayout
android:id="#+id/driverInfo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/driverTitle"
android:background="#f8ffe1">
<ImageView
android:id="#+id/driverPhoto"
android:layout_width="65dp"
android:layout_height="65dp"
android:paddingRight="8dp"
android:paddingLeft="0dp"
android:paddingTop="0dp" />
<TextView
android:id="#+id/driverName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:layout_toRightOf="#+id/driverPhoto"
android:textColor="#333333"
android:textSize="16sp" />
<TextView
android:id="#+id/driverEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/driverName"
android:layout_toRightOf="#+id/driverPhoto"
android:textColor="#999999"
android:textSize="14sp" />
<TextView
android:id="#+id/driverPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/driverEmail"
android:layout_toRightOf="#+id/driverPhoto"
android:paddingBottom="10dp"
android:textColor="#333333"
android:textSize="14sp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/passengersInfo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/driverInfo"
android:paddingTop="10dp">
<TextView
android:id="#+id/passengersTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|center_vertical"
android:paddingTop="7dp"
android:paddingBottom="2dp"
android:textColor="#333333"
android:textSize="14sp"
android:text="#string/passengers_title" />
<TextView
android:id="#+id/noPassengers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="#+id/passengersTitle"
android:textColor="#333333"
android:textSize="14sp"
android:text="#string/no_passengers"
android:visibility="gone" />
<LinearLayout
android:id="#+id/passengersList"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_below="#+id/passengersTitle"
android:orientation="vertical" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/discussion"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/passengersInfo"
android:paddingTop="10dp">
<TextView
android:id="#+id/discussionTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dp"
android:textColor="#333333"
android:textSize="14sp"
android:text="#string/discussion_title" />
<LinearLayout
android:id="#+id/discussionList"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_below="#+id/discussionTitle"
android:orientation="vertical" />
<TextView
android:id="#+id/addMessageLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="7dp"
android:paddingBottom="2dp"
android:textColor="#8ec83e"
android:textSize="14sp"
android:layout_below="#+id/discussionList"
android:layout_centerHorizontal="true"
android:text="#string/add_message" />
<LinearLayout android:id="#+id/newMessageLayout"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_below="#+id/addMessageLink"
android:orientation="horizontal"
android:paddingTop="7dp"
android:paddingBottom="2dp"
android:visibility="gone">
<EditText
android:id="#+id/newMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#333333"
android:textSize="14sp"
android:hint="#string/new_message"
android:layout_weight="3" />
<Button
android:id="#+id/addMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#333333"
android:textSize="14sp"
android:hint="#string/send_message"
android:layout_gravity="right"
android:layout_weight="1" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/waypointsDetail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/discussion"
android:paddingTop="10dp">
<TextView
android:id="#+id/waypointsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="2dp"
android:textColor="#333333"
android:textSize="14sp"
android:text="#string/waypoints_title" />
<LinearLayout android:id="#+id/waypointsList"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_below="#+id/waypointsTitle"
android:orientation="vertical" />
<TextView
android:id="#+id/waypointsSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="2dp"
android:textColor="#333333"
android:textSize="14sp"
android:layout_below="#+id/waypointsList" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>

ScrollView in the form is not working in android

I have made a simple form in android and have put all the form contents in that scrollView but my scrollView doesnt working ,It not scrolls down,My code is as below:
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<View
android:id="#+id/line"
android:layout_width="fill_parent"
android:layout_height="7dp"
android:layout_alignParentTop="true"
android:background="#4fc1e9" />
<TextView
android:id="#+id/title_reg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/line"
android:gravity="center"
android:padding="13dp"
android:text="#string/title_registration"
android:textColor="#cecece"
android:textSize="16dp"
android:textStyle="bold" />
<RelativeLayout
android:id="#+id/btn_qq_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/title_reg" >
<TextView
android:id="#+id/tv_qq_login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#5d9cec"
android:gravity="center"
android:padding="12dp"
android:text="#string/qq_login"
android:textColor="#ffffff"
android:textSize="18dp"
android:textStyle="bold" />
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="#+id/btn_qq_login"
android:fillViewport="true" >
<RelativeLayout
android:id="#+id/rl_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/txt_or"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="#string/or"
android:textColor="#cecece"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txt_reg_new_account"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_or"
android:autoLink="web"
android:gravity="center"
android:text="#string/reg_new_account"
android:textColor="#cecece"
android:textColorLink="#cecece"
android:textSize="16dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txt_ur_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_reg_new_account"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_name"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_name"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_name"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
<TextView
android:id="#+id/txt_ur_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/et_txt_ur_name"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_email"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_email"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_email"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
<TextView
android:id="#+id/txt_ur_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/et_txt_ur_email"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_phone_number"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_phone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_phone"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_phone_number"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
<TextView
android:id="#+id/txt_ur_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/et_txt_ur_phone"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="#string/reg_pwd"
android:textColor="#cecece"
android:textSize="14dp" />
<EditText
android:id="#+id/et_txt_ur_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/txt_ur_password"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="15dp"
android:background="#drawable/bg_editext"
android:hint="#string/hint_reg_pwd"
android:padding="8dp"
android:textColorHint="#cecece"
android:textSize="14dp" />
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/reg_bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#f5f7f9"
android:paddingBottom="5dp" >
<Button
android:id="#+id/btn_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:background="#drawable/btn_register"
android:gravity="center"
android:text="#string/btn_reg"
android:textColor="#ffffff" />
<TextView
android:id="#+id/txt_already_member"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_register"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="#string/txt_already_member"
android:textColor="#babfc3"
android:textSize="12dp" />
<TextView
android:id="#+id/txt_already_login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/btn_register"
android:layout_centerHorizontal="true"
android:layout_marginLeft="3dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/txt_already_member"
android:autoLink="web"
android:text="#string/txt_already_login"
android:textColor="#3a91ea"
android:textColorLink="#cecece"
android:textSize="12dp" />
</RelativeLayout>
<ImageView
android:id="#+id/iv_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="47dp"
android:background="#drawable/qq" />
</RelativeLayout>
Please help me sort it out..Thank you
you have problem with ScrollView.you need to specify to the scroll view for scrolling.
just add below property in to ScrollView
android:layout_above="#+id/reg_bottom"
you need to bind your scroll view.
thanx.

How to make one part of view (relativelayout) scroll, but another part not move?

I have a RelativeLayout that is a detail page for search results. It displays a bunch of different TextViews, has a table or two, and also holds a SupportMapFragment. I want that portion to be scrollable. I also have a LinearLayout that holds an EditText and a Button at the bottom of the view that should always be visible at the bottom. It's small, maybe an 1/8th of the total view height, and I just want it to always stay there.
I tried to wrap the layout I want scrolling in a ScrollView, leave the other layout out of that, and then wrap the whole thing in a RelativeLayout. The yields a scrollbar, but it doesn't move more than just a tiny, tiny bit, and when it does, there is a little black space revealed where the SupportMapFragment moves from.
How can I set up my layouts to scroll the portion I want scrolling, and leave the other portion alone? Do I need to convert this whole activity to a FragmentActivity?
The layout file I'm wrangling is here:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/detailFragment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#D0E4F7"
android:paddingBottom="5dp"
android:paddingLeft="12dp"
android:paddingRight="12dp" >
<ScrollView
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_above="#+id/tagVenue"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#D0E4F7"
android:paddingBottom="5dp"
android:paddingLeft="1dp"
android:paddingRight="1dp" >
<TextView
android:id="#+id/vName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:text="Fore Street Bar and Grill"
android:textIsSelectable="true"
android:textStyle="bold" />
<TextView
android:id="#+id/vAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vName"
android:layout_marginTop="5dp"
android:textIsSelectable="true"
android:text="105 Congress St. \nPortland, ME 04055"/>
<TextView
android:id="#+id/vPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vAddress"
android:textIsSelectable="true"
android:layout_marginTop="5dp"
android:text="207-555-1111"/>
<TextView
android:id="#+id/vWeb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vPhone"
android:textIsSelectable="true"
android:layout_marginTop="5dp"
android:text="www.xyz.com"/>
<TextView
android:id="#+id/vDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="true"
android:layout_below="#+id/map"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="100 meters away"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vCuisine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vWeb"
android:textIsSelectable="true"
android:layout_marginTop="5dp"
android:text="American, Fusion"/>
<TextView
android:id="#+id/vHours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vRating"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:text="Hours: 10:00 - 22:00 Currently open!"
android:textIsSelectable="true"
android:textStyle="bold" />
<TextView
android:id="#+id/vRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vCuisine"
android:textIsSelectable="true"
android:text="5 Stars"/>
<View
android:id="#+id/dividing_line"
android:layout_height="1dp"
android:layout_width="fill_parent"
android:background="#000000"
android:layout_below="#+id/vHours"
android:layout_marginTop="5dp"/>
<!-- SupportMapFragment -->
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="120dip"
android:layout_height="120dip"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp" />
<TableLayout
android:id="#+id/table1"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_below="#+id/dividing_line"
android:layout_marginTop="5dp">
<TableRow
android:id="#+id/tableRow1a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="2">
<TextView
android:id="#+id/vtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight=".7"
android:text="text"
android:textIsSelectable="true"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1.3"
android:text="93/100"
android:textIsSelectable="true"
android:textSize="20dp"
android:textStyle="bold" />
</TableRow>
</TableLayout>
<TableLayout
android:id="#+id/table2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/table1"
android:layout_marginTop="5dp" >
<TableRow
android:id="#+id/tableRow1b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="#+id/tableRow3b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag1Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow4b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag2Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow5b"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="#+id/vtext3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag3Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow6b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag4Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow7b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag5Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow8b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag6Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
</TableLayout>
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/textdlfka"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="#+id/detailFragment" >
<EditText
android:id="#+id/text7"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/Button01"
android:hint="#string/search" >
</EditText>
<Button
android:id="#+id/Button01"
android:layout_width="wrap_content"
android:layout_height="40dip"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="#string/search" >
</Button>
</RelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/detailFragment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#D0E4F7"
android:paddingBottom="5dp"
android:paddingLeft="12dp"
android:paddingRight="12dp" >
<ScrollView
android:id="#+id/scrollview"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_above="#+id/textdlfka"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#D0E4F7"
android:paddingBottom="5dp"
android:paddingLeft="1dp"
android:paddingRight="1dp" >
<TextView
android:id="#+id/vName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:text="Fore Street Bar and Grill"
android:textIsSelectable="true"
android:textStyle="bold" />
<TextView
android:id="#+id/vAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vName"
android:layout_marginTop="5dp"
android:text="105 Congress St. \nPortland, ME 04055"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vAddress"
android:layout_marginTop="5dp"
android:text="207-555-1111"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vWeb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vPhone"
android:layout_marginTop="5dp"
android:text="www.xyz.com"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="true"
android:layout_below="#+id/map"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="100 meters away"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vCuisine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vWeb"
android:layout_marginTop="5dp"
android:text="American, Fusion"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vHours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vRating"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:text="Hours: 10:00 - 22:00 Currently open!"
android:textIsSelectable="true"
android:textStyle="bold" />
<TextView
android:id="#+id/vRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/vCuisine"
android:text="5 Stars"
android:textIsSelectable="true" />
<View
android:id="#+id/dividing_line"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:layout_below="#+id/vHours"
android:layout_marginTop="5dp"
android:background="#000000" />
<!-- SupportMapFragment -->
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="120dip"
android:layout_height="120dip"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="5dp" />
<TableLayout
android:id="#+id/table1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/dividing_line"
android:layout_marginTop="5dp" >
<TableRow
android:id="#+id/tableRow1a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:weightSum="2" >
<TextView
android:id="#+id/vtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight=".7"
android:text="text"
android:textIsSelectable="true"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
android:id="#+id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_weight="1.3"
android:text="93/100"
android:textIsSelectable="true"
android:textSize="20dp"
android:textStyle="bold" />
</TableRow>
</TableLayout>
<TableLayout
android:id="#+id/table2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/table1"
android:layout_marginTop="5dp" >
<TableRow
android:id="#+id/tableRow1b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true"
android:textStyle="bold" />
</TableRow>
<TableRow
android:id="#+id/tableRow3b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/text4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag1Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow4b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag2Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow5b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag3Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow6b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag4Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow7b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag5Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
<TableRow
android:id="#+id/tableRow8b"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/vtext6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
<TextView
android:id="#+id/vTag6Mag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="text"
android:textIsSelectable="true" />
</TableRow>
</TableLayout>
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/textdlfka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/scrollview" >
<EditText
android:id="#+id/text7"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/Button01"
android:hint="#string/search" >
</EditText>
<Button
android:id="#+id/Button01"
android:layout_width="wrap_content"
android:layout_height="40dip"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="#string/search" >
</Button>
</RelativeLayout>
</RelativeLayout>

Categories

Resources