1. Download our Official Android App: Forums for Android!

Apps How to use HorizontalScrollView?

Discussion in 'Android Development' started by Ankit2502, Aug 10, 2010.

  1. Ankit2502

    Ankit2502 Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    13
    Joined:
    Jan 6, 2010

    Jan 6, 2010
    13
    0
    15
    Android Developer
    Indore
    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
    Rank:
    None
    Points:
    38
    Posts:
    124
    Joined:
    Apr 23, 2010

    Apr 23, 2010
    124
    17
    38
    Software Engineer
    UK
    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
    Rank:
    None
    Points:
    38
    Posts:
    124
    Joined:
    Apr 23, 2010

    Apr 23, 2010
    124
    17
    38
    Software Engineer
    UK

Share This Page

Loading...