1. Check out our companion app, Forums for Android! Download from Google Play

Scrollable tabs

Discussion in 'Application Development' started by bscarl88, Jul 8, 2010.

  1. bscarl88

    bscarl88 Member
    Thread Starter
    6

    Jul 2, 2010
    8
    1
    6
    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
    Thread Starter
    6

    Jul 2, 2010
    8
    1
    6
    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...