How to use HorizontalScrollView?


Last Updated:

  1. Ankit2502

    Ankit2502 Member This Topic's Starter

    Joined:
    Jan 6, 2010
    Messages:
    13
    Likes Received:
    0
    Hello Friends,
    I have some query regarding HorizontalScrollView, i want to produce a tab like effect on HorizontalScrollView means when i select a particular Tab item of that tab is visible and this whole view is scrollable.Does anybody know how to do this using HorizontalScrollView.....
     

    Advertisement
  2. blundell

    blundell Well-Known Member

    Joined:
    Apr 23, 2010
    Messages:
    125
    Likes Received:
    17
    Do you just mean:
    Code (Text):
    1.  
    2. <TabHost
    3.         xmlns:android="http://schemas.android.com/apk/res/android"
    4.         xmlns:app="http://schemas.android.com/apk/res/com.blundell"
    5.     android:id="@android:id/tabhost"
    6.     android:layout_width="fill_parent"
    7.     android:layout_height="fill_parent">
    8.         <TabWidget
    9.         android:id="@android:id/tabs"
    10.         android:layout_width="fill_parent"
    11.         android:layout_height="wrap_content"
    12.         />
    13.         <HorizontalScrollView
    14.          android:id="@android:id/tabcontent"
    15.          android:layout_height="fill_parent"
    16.          android:layout_width="fill_parent">
    17.  
    18.                      <!-- Blah contents -->
    19.  
    20.         </HorizontalScrollView >
    21. </TabHost>
    22.  
    This is a tab view with only one tab obviously
     
  3. blundell

    blundell Well-Known Member

    Joined:
    Apr 23, 2010
    Messages:
    125
    Likes Received:
    17

Share This Page

Loading...