Java android.widget ScrollView fields, constructors, methods, implement or subclass

Example usage for Java android.widget ScrollView fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.widget ScrollView.

The text is from its open source code.

Subclass

android.widget.ScrollView has subclasses.
Click this link to see all its subclasses.

Constructor

Method

voidaddView(View child)
voidaddView(View child, int index)
voidaddView(View child, ViewGroup.LayoutParams params)
voidaddView(View child, int index, ViewGroup.LayoutParams params)
booleancanScrollVertically(int direction)
Check if this view can be scrolled vertically in a certain direction.
intcomputeVerticalScrollExtent()

Compute the vertical extent of the vertical scrollbar's thumb within the vertical range.

intcomputeVerticalScrollOffset()
intcomputeVerticalScrollRange()

The scroll range of a scroll view is the overall height of all of its children.

voiddraw(Canvas canvas)
TfindViewById(@IdRes int id)
Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid (< 0) or there is no matching view in the hierarchy.
booleanfullScroll(int direction)

Handles scrolling in response to a "home/end" shortcut press.

ViewgetChildAt(int index)
Returns the view at the specified position in the group.
intgetChildCount()
Returns the number of children in the group.
voidgetDrawingRect(Rect outRect)
Return the visible drawing bounds of your view.
intgetHeight()
Return the height of your view.
voidgetHitRect(Rect outRect)
Hit rectangle in parent's coordinates
ViewGroup.LayoutParamsgetLayoutParams()
Get the LayoutParams associated with this view.
voidgetLocationOnScreen(@Size(2) int[] outLocation)

Computes the coordinates of this view on the screen.

intgetMeasuredHeight()
Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ).
intgetPaddingBottom()
Returns the bottom padding of this view.
intgetPaddingTop()
Returns the top padding of this view.
ViewParentgetParent()
Gets the parent of this view.
ResourcesgetResources()
Returns the resources associated with this view.
intgetScrollY()
Return the scrolled top position of this view.
ViewTreeObservergetViewTreeObserver()
Returns the ViewTreeObserver for this view's hierarchy.
intgetVisibility()
Returns the visibility status for this view.
intgetWidth()
Return the width of your view.
floatgetY()
The visual y position of this view, in pixels.
voidinvalidate()
Invalidate the whole view.
voidmeasure(int widthMeasureSpec, int heightMeasureSpec)

This is called to find out how big a view should be.

voidoffsetDescendantRectToMyCoords(View descendant, Rect rect)
Offset a rectangle that is in a descendant's coordinate space into our coordinate space.
booleanpost(Runnable action)

Causes the Runnable to be added to the message queue.

booleanpostDelayed(Runnable action, long delayMillis)

Causes the Runnable to be added to the message queue, to be run after the specified amount of time elapses.

voidremoveAllViews()
Call this method to remove all child views from the ViewGroup.
voidrequestDisallowInterceptTouchEvent(boolean disallowIntercept)
voidrequestLayout()
voidscrollTo(int x, int y)

This version also clamps the scrolling to the bounds of our child.

voidsetAccessibilityDelegate(@Nullable AccessibilityDelegate delegate)
Sets a delegate for implementing accessibility support via composition (as opposed to inheritance).
voidsetBackground(Drawable background)
Set the background to a given Drawable, or remove the background.
voidsetBackgroundColor(@ColorInt int color)
Sets the background color for this view.
voidsetDescendantFocusability(int focusability)
Set the descendant focusability of this view group.
voidsetFadingEdgeLength(int length)
Set the size of the faded edge used to indicate that more content in this view is available.
voidsetFillViewport(boolean fillViewport)
Indicates this ScrollView whether it should stretch its content height to fill the viewport or not.
voidsetFocusable(boolean focusable)
Set whether this view can receive the focus.
voidsetFocusableInTouchMode(boolean focusableInTouchMode)
Set whether this view can receive focus while in touch mode.
voidsetHorizontalScrollBarEnabled(boolean horizontalScrollBarEnabled)

Define whether the horizontal scrollbar should be drawn or not.

voidsetLayoutParams(ViewGroup.LayoutParams params)
Set the layout parameters associated with this view.
voidsetOnTouchListener(OnTouchListener l)
Register a callback to be invoked when a touch event is sent to this view.
voidsetOverScrollMode(int mode)
voidsetPadding(int left, int top, int right, int bottom)
Sets the padding.
voidsetScrollY(int value)
Set the vertical scrolled position of your view.
voidsetSmoothScrollingEnabled(boolean smoothScrollingEnabled)
Set whether arrow scrolling will animate its transition.
voidsetTag(final Object tag)
Sets the tag associated with this view.
voidsetVerticalScrollBarEnabled(boolean verticalScrollBarEnabled)

Define whether the vertical scrollbar should be drawn or not.

voidsetVisibility(@Visibility int visibility)
Set the visibility state of this view.
voidsmoothScrollTo(int x, int y)
Like #scrollTo , but scroll smoothly instead of immediately.
voidstartAnimation(Animation animation)
Start the specified animation now.