1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to use HorizontalScrollView?

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

  1. Ankit2502

    Ankit2502 Newbie
    Thread Starter

    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.....
     


  2. blundell

    blundell Well-Known Member

    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

Share This Page

Loading...