I solved it !!!! :)
I used only one scrollview.... I inserted the whole FrameLayout with
its children inside the scrollview, and everything works !!!! :)
here's the 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">
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TabWidget android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"/>
<ScrollView android:id="@+id/scroll1"
android:layout_height="match_parent"
android:layout_width="match_parent">
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/tabcontent">
<!-- all the tabs here -->
</FrameLayout>
</ScrollView>
</LinearLayout>
</TabHost>
On 18 Lug, 14:04, homerz <[email protected]> wrote:
> ok, sorry.. I should have shown the code too...
> anyway thankyou for your reply..
>
> public class CreateDraftActivity extends TabActivity {
> @Override
> protected void onCreate(Bundle savedInstanceState) {
>
> super.onCreate(savedInstanceState);
> setContentView(R.layout.creazione_rosa);
>
> final TabHost
> tabHost=(TabHost)findViewById(android.R.id.tabhost);
>
> TabSpec specP = tabHost.newTabSpec("Portieri");
> specP.setContent(R.id.tabPortieri);
> specP.setIndicator("Portieri");
>
> TabSpec specD = tabHost.newTabSpec("Difensori");
> specD.setContent(R.id.tabDifensori);
> specD.setIndicator("Difensori");
>
> TabSpec specC = tabHost.newTabSpec("Centrocampisti");
> specC.setContent(R.id.tabCentrocampisti);
> specC.setIndicator("Centrocampisti");
>
> TabSpec specA = tabHost.newTabSpec("Attaccanti");
> specA.setContent(R.id.tabAttaccanti);
> specA.setIndicator("Attaccanti");
>
> tabHost.addTab(specP);
> tabHost.addTab(specD);
> tabHost.addTab(specC);
> tabHost.addTab(specA);
>
> // These fill the spinners
> fillSpnGoalkeepers();
> fillSpnDefenders();
> fillSpnMidfielders();
> fillSpnForwarders();
>
> }
>
> On 15 Lug, 20:52, Mark Murphy <[email protected]> wrote:
>
>
>
>
>
>
>
> > You only have one tab. Yourtabs, 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 <[email protected]> wrote:
> > > Hi everybody,
> > > I'm building an application with 4tabs; 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
> > > othertabs, nothing happens...tabsdon't switch and no error is
> > > logging....
>
> > > I manage alltabsin 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 thescrollviews, I can see alltabs....
>
> > > 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"/>
>
> > >
>
> ...
>
> leggi tutto
--
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