Skip to main content

HorizontalScrollView

declare class HorizontalScrollView extends FrameLayout {}

Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. A HorizontalScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects. A child that is often used is a LinearLayout in a horizontal orientation, presenting a horizontal array of top-level items that the user can scroll through.

Instance Method

scrollTo

declare class HorizontalScrollView {
scrollTo(x:number, y:number):void
}
  • Description

    Set the scrolled position of your view.
    This version also clamps the scrolling to the bounds of our child.

smoothScrollTo

declare class HorizontalScrollView {
smoothScrollTo(x:number, y:number)
}
  • Description

    Like scrollTo(number, number), but scroll smoothly instead of immediately.