You only have one tab. Your tabs, in this design, are the immediate
children of your FrameLayout. You have one such child -- a
LinearLayout.

On Fri, Jul 15, 2011 at 10:43 AM, homerz <dgel...@gmail.com> wrote:
> Hi everybody,
> I'm building an application with 4 tabs; each tab has a scrollview
> with some textview, some spinners and 2 buttons...
>
> my problem is that only the current tab is displayed, when I click on
> other tabs, nothing happens... tabs don't switch and no error is
> logging....
>
> I manage all tabs in just one activity, but I've tried to set an
> activity for each tab, with their own layout xml, but the problem was
> the same....
>
> If I disable the scrollviews, I can see all tabs....
>
> Thanks to anyone who will help me :)
>
> here my layout xml:
>
>
> <TabHost android:layout_width="match_parent"
>                android:layout_height="match_parent"
>        android:id="@android:id/tabhost"
>                xmlns:android="http://schemas.android.com/apk/res/android";>
>
>        <TabWidget android:layout_width="match_parent"
>                   android:layout_height="wrap_content"
>                   android:id="@android:id/tabs"/>
>     <FrameLayout android:layout_width="match_parent"
>                          android:layout_height="match_parent"
>                          android:id="@android:id/tabcontent">
>    <!-- TAB PORTIERI -->
>   <LinearLayout android:id="@+id/tabPortieri"
>                          android:layout_width="match_parent"
>                          android:layout_height="match_parent"
>                          android:orientation="vertical"
>                          
> xmlns:android="http://schemas.android.com/apk/res/android";>
>        <ScrollView android:id="@+id/scroll1"
>                   android:layout_height="match_parent"
>                   android:layout_width="match_parent">
>                <LinearLayout android:layout_width="match_parent"
>                                  android:layout_height="wrap_content"
>                                  android:id="@+id/bodyPortieri"
>                                  android:orientation="vertical"
>                                  android:paddingTop="60px">
>
>                        <TextView android:layout_width="match_parent"
>                                  android:layout_height="50px"
>                                  android:text="Scegli 3 portieri:"
>                                  android:textSize="20dp"
>                                  android:textStyle="bold"
>                                  android:id="@+id/txtPortieri"/>
>
>                <TextView android:id="@+id/lblGk1"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Portiere #1:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnGk1"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblGk2"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Portiere #2:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnGk2"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblGk3"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Portiere #3:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnGk3"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>                        <RelativeLayout
>                                android:id="@+id/gkBtnBar"
>                                android:layout_width="match_parent"
>                                android:layout_height="wrap_content">
>
>                                <Button
>                                    android:id="@+id/btnSaveGk"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Salva">
>                                </Button>
>                                <Button
>                                    android:id="@+id/btnResetGk"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Reset"
>                                    android:layout_toRightOf="@+id/btnSaveGk">
>                                </Button>
>                        </RelativeLayout>
>
>            </LinearLayout>
>    </ScrollView>
>   </LinearLayout>
>
>    <!-- TAB DIFENSORI -->
>  <LinearLayout android:id="@+id/tabDifensori"
>                          android:layout_width="match_parent"
>                          android:layout_height="match_parent"
>                          android:orientation="vertical"
>                          
> xmlns:android="http://schemas.android.com/apk/res/android";>
>
>    <ScrollView android:id="@+id/scroll2"
>                   android:layout_height="match_parent"
>                   android:layout_width="match_parent">
>            <LinearLayout android:layout_width="match_parent"
>                                  android:layout_height="wrap_content"
>                                  android:id="@+id/bodyDifensori"
>                                  android:orientation="vertical"
>                                  android:paddingTop="60px">
>
>                        <TextView android:layout_width="match_parent"
>                          android:layout_height="50px"
>                          android:text="Scegli 9 Difensori:"
>                          android:textSize="20dp"
>                          android:textStyle="bold"
>                          android:id="@+id/txtDifensori"/>
>
>                <TextView android:id="@+id/lblDif1"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #1:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif1"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif2"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #2:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif2"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif3"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #3:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif3"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif4"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #4:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif4"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif5"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #5:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif5"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif6"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #6:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif6"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif7"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #7:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif7"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif8"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #8:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif8"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblDif9"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Difensore #9:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnDif9"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                        <RelativeLayout
>                                android:id="@+id/difBtnBar"
>                                android:layout_width="match_parent"
>                                android:layout_height="wrap_content">
>
>                                <Button
>                                    android:id="@+id/btnSaveDif"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Salva">
>                                </Button>
>                                <Button
>                                    android:id="@+id/btnResetDif"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Reset"
>                                    android:layout_toRightOf="@+id/btnSaveDif">
>                                </Button>
>                        </RelativeLayout>
>
>            </LinearLayout>
>    </ScrollView>
>   </LinearLayout>
>
>    <!-- TAB CENTROCAMPISTI -->
>  <LinearLayout android:id="@+id/tabCentrocampisti"
>                          android:layout_width="match_parent"
>                          android:layout_height="match_parent"
>                          android:orientation="vertical"
>                          
> xmlns:android="http://schemas.android.com/apk/res/android";>
>    <ScrollView android:id="@+id/scroll3"
>                   android:layout_height="match_parent"
>                   android:layout_width="match_parent">
>            <LinearLayout android:layout_width="match_parent"
>                                  android:layout_height="wrap_content"
>                                  android:id="@+id/bodyCentrocampisti"
>                                  android:orientation="vertical"
>                                  android:paddingTop="60px">
>
>                        <TextView android:layout_width="match_parent"
>                                  android:layout_height="50px"
>                                  android:text="Scegli 8 centrocampisti:"
>                                  android:textSize="20dp"
>                                  android:textStyle="bold"
>                                  android:id="@+id/txtCentrocampisti"/>
>
>                <TextView android:id="@+id/lblCentr1"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #1:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr1"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblCentr2"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #2:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr2"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblCentr3"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #3:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr3"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblCentr4"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #4:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr4"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblCentr5"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #5:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr5"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblCentr6"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #6:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr6"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblCentr7"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #7:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr7"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblCentr8"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Centrocampista #8:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnCentr8"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                        <RelativeLayout
>                                android:id="@+id/centBtnBar"
>                                android:layout_width="match_parent"
>                                android:layout_height="wrap_content">
>
>                                <Button
>                                    android:id="@+id/btnSaveCentr"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Salva">
>                                </Button>
>                                <Button
>                                    android:id="@+id/btnResetCentr"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Reset"
>                                    
> android:layout_toRightOf="@+id/btnSaveCentr">
>                                </Button>
>                        </RelativeLayout>
>
>            </LinearLayout>
>     </ScrollView>
>    </LinearLayout>
>    <!-- TAB ATTACCANTI -->
>  <LinearLayout android:id="@+id/tabAttaccanti"
>                          android:layout_width="match_parent"
>                          android:layout_height="match_parent"
>                          android:orientation="vertical"
>                          
> xmlns:android="http://schemas.android.com/apk/res/android";>
>    <ScrollView android:id="@+id/scroll4"
>                    android:layout_height="match_parent"
>                    android:layout_width="match_parent">
>                <LinearLayout android:layout_width="match_parent"
>                                  android:layout_height="wrap_content"
>                                  android:id="@+id/bodyAttaccanti"
>                                  android:orientation="vertical"
>                                  android:paddingTop="60px">
>
>                        <TextView android:layout_width="match_parent"
>                                  android:layout_height="50px"
>                                  android:text="Scegli 6 attaccanti:"
>                                  android:textSize="20dp"
>                                  android:textStyle="bold"
>                                  android:id="@+id/txtAttaccanti"/>
>
>                <TextView android:id="@+id/lblAtt1"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Attaccante #1:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnAtt1"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblAtt2"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Attaccante #2:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnAtt2"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblAtt3"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Attaccante #3:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnAtt3"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblAtt4"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Attaccante #4:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnAtt4"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblAtt5"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Attaccante #5:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnAtt5"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                <TextView android:id="@+id/lblAtt6"
>                                  android:layout_width="wrap_content"
>                                  android:layout_height="wrap_content"
>                                  android:text="Attaccante #6:"
>                                  android:layout_alignParentLeft="true"/>
>                <Spinner android:id="@+id/spnAtt6"
>                                 android:layout_height="wrap_content"
>                                 android:layout_width="match_parent"
>                                 android:drawSelectorOnTop = "true"/>
>
>                        <RelativeLayout
>                                android:id="@+id/attBtnBar"
>                                android:layout_width="match_parent"
>                                android:layout_height="wrap_content">
>
>                                <Button
>                                    android:id="@+id/btnSaveAtt"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Salva">
>                                </Button>
>                                <Button
>                                    android:id="@+id/btnResetAtt"
>                                    android:layout_width="wrap_content"
>                                    android:layout_height="wrap_content"
>                                    android:layout_gravity="center_horizontal"
>                                    android:layout_marginTop="10sp"
>                                    android:text="Reset"
>                                    android:layout_toRightOf="@+id/btnSaveAtt">
>                                </Button>
>                        </RelativeLayout>
>
>            </LinearLayout>
>    </ScrollView>
>   </LinearLayout>
>
>  </FrameLayout>
>
>
> </TabHost>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

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

Reply via email to