I am creating an application using TabLayout and am having problems with the display when using Intents to load different classes.
I tried creating it using the method explained in the Android Development guide seen here
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
However the problem I am having is, that I want the tabs along the bottom of the application rather than the top which I have done. The problem is that there is not enough space on screen to view the whole application so when I click a new tab and it loads its layout, it goes right through the tabs. I tried adding ScrollView but it doesn't seem to work.
Any suggestions as to how to fix this so when I load a screen I can scroll up and down the page with my tabs always appearing at the bottom and not have my layout clip through my tabs.
Any help would be much appreciated
Code for my main.xml is
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#92c223">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="5dp">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="5dp" />
</LinearLayout>
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_gravity="bottom" />
</TabHost>
Also the code I used to swap between tabs in java is
intent = new Intent().setClass(this, tag.class);
spec = tabHost.newTabSpec("tag1")
.setIndicator("tag1", res.getDrawable(R.drawable.icon))
.setContent(intent);
tabHost.addTab(spec);
intent = new Intent().setClass(this, tag2.class);
spec = tabHost.newTabSpec("tag2")
.setIndicator("tag2", res.getDrawable(R.drawable.icon2))
.setContent(intent);
tabHost.addTab(spec);