I want to have different number of tabs and I am using TabHost. these could be between 1 to 8 in number depending on data.
I want to have horizontal scroll added so that when all 8 are there it doesn't look cramped up.
Issue is when 5 or more are there it looks fine and scroll works ! But when number of tabs are less I see blank space. tabs are not getting stretched to fill in the extra space.
How can I resolve this ? Can this be done via Java code ?
here is my layout xml...
<?xml version="1.0" encoding="utf-8"?>
<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" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!---Other Views--->
<HorizontalScrollView
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" />
</HorizontalScrollView>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</TabHost>