tags:

views:

57

answers:

1

Hi,

I'm currently working on my first android application. I am using a tabbed layout for my application. I followed the tutorial for this on the dev guide and ran into a problem. The tutorial only used three tabs, but I have a need for more. As such, the tabs resize and bunch up. I was hoping someone could tell me how I can make them scroll, like in dolphin browser when using multiple tabs. Thanks!

~aaron

A: 

in this case you probably dont want to use tabs. Rather, you can put all of your "tabs" in to a horizontal linear layout at the top of the screen wrapped in a ScrollView like this

<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content" android:layout_width="fill_parent">
    <LinearLayout 
        android:orientation="horizontal" android:layout_height="wrap_content"
        android:layout_width="fill_parent">

        ...buttons go here...

    </LinearLayout>
</HorizontalScrollView>

I think that this will give you the result you are looking for, but let me know

mtmurdock
edited to use HorizontalScrollView instead of ScrollView (which scrolls vertical only)
mtmurdock
Thanks. I will attempt to implement it this way and let you know.
Nemisis7654