Scrollable tabs


Last Updated:

  1. bscarl88

    bscarl88 Member This Topic's Starter

    Joined:
    Jul 2, 2010
    Messages:
    8
    Likes Received:
    1
    I am creating a template for my app using the tutorial for the tabbed layout (like the music player on moto droid) The problem is, I need 7 tabs, and some have multiple words on them. I would like to keep going with the tab idea, but I was wondering if there was away to have scrollable tabs so I can designate a size for each then scroll through them horizontally. Any help is greatly appreciated!
     

    Advertisement
  2. bscarl88

    bscarl88 Member This Topic's Starter

    Joined:
    Jul 2, 2010
    Messages:
    8
    Likes Received:
    1
    After I played with the code some more, I ended up figuring it out. you have to wrap the tabwidget in horizontalScrollView as such...

    Code (Text):
    1.             <HorizontalScrollView
    2.                 android:layout_width="wrap_content"
    3.                 android:layout_height="wrap_content">
    4.                     <TabWidget
    5.                         android:orientation="horizontal"
    6.                         android:id="@android:id/tabs"
    7.                         android:layout_width="wrap_content"
    8.                         android:layout_height="wrap_content"
    9.                         android:background="#ff000066"
    10.                         >
    11.                     </TabWidget>
    12.             </HorizontalScrollView>
    13.  
     
    pkpmoa1536 likes this.

Share This Page

Loading...