Search code examples
androidscrollviewandroid-scrollview

how to add horizontal property to scrollview layout


Please tell me how to add horizontal property to scrollview, I have set of buttons arranged horizontally which I need to scroll horizontally.


Solution

  • Use HorizontalScrollView

    <HorizontalScrollView
       android:id="@+id/hsv"
       android:layout_height="wrap_content"
       android:layout_width="fill_parent"
       android:layout_weight="0"
       android:fillViewport="true"
       android:measureAllChildren="false"
       android:scrollbars="none" >
       <LinearLayout
          android:id="@+id/innerLay"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:orientation="horizontal" >
       </LinearLayout>
    
    </HorizontalScrollView>