Android Guides | Samples

Android.Widget.HorizontalScrollView Class

Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display.

See Also: HorizontalScrollView

Syntax

[Android.Runtime.Register("android/widget/HorizontalScrollView", DoNotGenerateAcw=true)]
public class HorizontalScrollView : FrameLayout

Remarks

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.

The TextView class also takes care of its own scrolling, so does not require a HorizontalScrollView, but using the two together is possible to achieve the effect of a text view within a larger container.

HorizontalScrollView only supports horizontal scrolling. For vertical scrolling, use either ScrollView or ListView.

[Android Documentation]

Requirements

Namespace: Android.Widget
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 3

The members of Android.Widget.HorizontalScrollView are listed below.

See Also: FrameLayout

Public Constructors

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

FillViewportBoolean. Indicates whether this HorizontalScrollView's content is stretched to fill the viewport.
[read-only]
MaxScrollAmountInt32.
SmoothScrollingEnabledBoolean.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

ArrowScroll(FocusSearchDirection) : Boolean
Handle scrolling in response to a left or right arrow click.
ExecuteKeyEvent(KeyEvent) : Boolean
You can call this function yourself to have the scroll view perform scrolling from a key event, just as if the event had been dispatched to it by the view hierarchy.
Fling(Int32)
Fling the scroll view
FullScroll(FocusSearchDirection) : Boolean
PageScroll(FocusSearchDirection) : Boolean
SmoothScrollBy(Int32, Int32)
Like View.ScrollBy(Int32,Int32), but scroll smoothly instead of immediately.
SmoothScrollTo(Int32, Int32)
Like HorizontalScrollView.scrollTo(int, int), but scroll smoothly instead of immediately.

Protected Methods

ComputeScrollDeltaToGetChildRectOnScreen(Rect) : Int32
Compute the amount to scroll in the X direction in order to get a rectangle completely on the screen (or, if taller than the screen, at least the first screen size chunk of it).