Hi All,
I have an application where i have a TabHost with 3 tabs.I have a
ScrollView in tab2 and also another ScrollView in tab1. The problem is
my ScrollView in tab2 shows up in tab1 too (the scroll bar is showing
up).

Can anyone tell me where i am going wrong.

My main.xml is given below.
Name of tab1 scrollview : @+id/ScrollViewOuputText
Name of tab2 scrollview : @+id/ScrollViewtablayout2


-------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>


<TabHost xmlns:android="http://schemas.android.com/apk/res/android";
    android:id="@android:id/tabhost"
    style="@style/TabStyle"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">


           <RelativeLayout android:id="@+id/tablayout1"
xmlns:android="http://schemas.android.com/apk/res/android";
                         android:layout_width="fill_parent"
                 android:layout_height="wrap_content">

                    <TextView
                        style="@style/LabelText"
                        android:id="@+id/tab1langlabel1"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:text="Language 1:"/>

                     <Spinner
                        style="@style/SpinnerStyle"
                        android:id="@+id/tab1spinner1"
                        android:layout_width="fill_parent"
                        android:drawSelectorOnTop="true"
                        android:prompt="@string/language_prompt"
                        android:layout_below="@id/tab1langlabel1"/>

                   <TextView
                                style="@style/LabelText"
                        android:id="@+id/tab1langlabel2"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:text="Language 2:"
                        android:layout_below="@id/tab1spinner1"/>



                    <Spinner
                        style="@style/SpinnerStyle"
                        android:id="@+id/tab1spinner2"
                        android:layout_width="fill_parent"
                        android:drawSelectorOnTop="true"
                        android:prompt="@string/language_prompt"
                        android:layout_below="@id/tab1langlabel2"/>


                         <Button
                        android:id="@+id/tab1WebButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@id/tab1spinner2"
                        android:layout_alignParentRight="true"
                        android:text="Web" />

                    <Button
                        android:id="@+id/tab1cancelButton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_toLeftOf="@+id/tab1WebButton"
                        android:layout_alignTop="@+id/tab1WebButton"
                        android:text="Clear" />

                    <Button
                        android:id="@+id/tab1okbutton"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_toLeftOf="@id/tab1cancelButton"
                        android:layout_alignTop="@id/tab1cancelButton"
                        android:text="Go" />

                     <ScrollView
                                 android:id="@+id/ScrollViewOuputText"
                                 android:layout_width="wrap_content"
                                 android:layout_height="400px"
                                 android:layout_below="@id/tab1cancelButton">
                            <TextView
                                        style="@style/OuputText"
                                        android:id="@+id/tab1outputtext"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text=""
                                    
android:layout_below="@id/tab1cancelButton"/>

                    </ScrollView>
                </RelativeLayout>

                <!-- TAB 2  -->
                <ScrollView
                 android:id="@+id/ScrollViewtablayout2"
                 android:layout_width="fill_parent"
                 android:layout_height="400px" >

                <TableLayout android:id="@+id/tablayout2" xmlns:android="http://
schemas.android.com/apk/res/android"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:numColumns="3"
                    android:verticalSpacing="10dp"
                    android:horizontalSpacing="10dp"
                    android:columnWidth="90dp"
                    android:stretchMode="columnWidth"
                    android:gravity="center"/>

                </ScrollView>
                <!-- TAB 2  -->


       <RelativeLayout android:id="@+id/tablayout3"
xmlns:android="http://schemas.android.com/apk/res/android";
                         android:layout_width="fill_parent"
                 android:layout_height="fill_parent">

                <ScrollView
                 android:id="@+id/ScrollViewHelpText"
                 android:layout_width="wrap_content"
                 android:layout_height="300px" >
                        <TextView
                                style="@style/LabelText"
                        android:id="@+id/helpTabText"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/help_content"/>

                </ScrollView>

                </RelativeLayout>

        </FrameLayout>
    </LinearLayout>
</TabHost>


Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to