public class UIScrollView extends UIView
NoIntrinsicMetric| Constructor and Description |
|---|
UIScrollView()
Constructs a default UIScrollView object located at (0,0) with 0 weight
and 0 height.
|
UIScrollView(CGRect frame)
Constructs a UIScrollView object initialized with the dimensions and
position specified in the frame parameter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraint(NSLayoutConstraint constraint)
Adds the specified constraint to this view.
|
boolean |
alwaysBounceHorizontal()
Returns a Boolean that shows whether there is bouncing of the content
when horizontal scrolling reaches the bounds of the content.
|
boolean |
alwaysBounceVertical()
Returns a Boolean that shows whether there is bouncing of the content
when vertical scrolling reaches the bounds of the content.
|
boolean |
bounces()
Returns a Boolean that shows whether the scroll view bounces when it
reaches the edge boundary.
|
boolean |
canCancelContentTouches()
Returns a Boolean that shows whether touches within the scroll view,
specifically touches on subviews, can trigger a scrolling or stop the
current scrolling.
|
List<NSLayoutConstraint> |
constraints()
Returns a list with the layout constraints of this view.
|
UIEdgeInsets |
contentInset()
Returns the distance that the content of the scroll view is inset inside
of the scroll view(expressed in points).
|
CGPoint |
contentOffset()
Returns the offset for the origin of the content, inside a scroll view,
relative to the origin of the scroll view.
|
CGSize |
contentSize()
Returns the size of the content view.
|
double |
decelerationRate()
Returns the deceleration rate after the finger is lifted.
|
boolean |
delaysContentTouches()
Returns a Boolean that shows whether the scrolling view handles scrolling
gestures with a delay.
|
UIScrollViewDelegate |
delegate()
Returns the delegate of this scroll view.
|
void |
flashScrollIndicators()
Displays the scroll indicators instantly.
|
UIView |
hitTest(CGPoint point,
UIEvent event)
Return the view that contains the point parameter and is remotest one in
the view hierarchy tree.
|
int |
indicatorStyle()
Returns the style of the indicator.
|
boolean |
isDecelerating()
Returns a Boolean that shows whether the content is scrolling even after
the finger was lifted.
|
boolean |
isDirectionalLockEnabled()
Returns a Boolean that shows whether the scrolling is permitted only for
one direction.
|
boolean |
isDragging()
Returns a Boolean that show whether the user has started a scrolling
gesture.
|
boolean |
isPagingEnabled()
Returns a Boolean that shows whether paging is enabled.
|
boolean |
isScrollEnabled()
Returns a Boolean that shows whether scrolling is enabled.
|
boolean |
isTracking()
Returns a Boolean that shows whether the user has touched the content(a
scrolling gesture is about to be recognized)
|
UIEdgeInsets |
scrollIndicatorInsets()
Returns the distance of the scroll indicator from the edges of the view.
|
void |
scrollRectToVisible(CGRect rect,
boolean animated)
Scrolls the specified area in order to be visible using animation or not.
|
boolean |
scrollsToTop()
Returns a Boolean that shows whether the scroll view moves to the top
after a tap on the status bar.
|
void |
setAlwaysBounceHorizontal(boolean alwaysBounceHorizontal)
Sets a Boolean that defines whether there is bouncing of the content when
horizontal scrolling reaches the bounds of the content.
|
void |
setAlwaysBounceVertical(boolean alwaysBounceVertical)
Sets a Boolean that defines whether there is bouncing of the content when
vertical scrolling reaches the bounds of the content.
|
void |
setBounces(boolean bounces)
Sets a Boolean that defines whether the scroll view bounces when it
reaches the edge boundary.
|
void |
setCanCancelContentTouches(boolean canCancelContentTouches)
Sets a Boolean that determines whether touches within the scroll view,
specifically touches on subviews, can trigger a scrolling or stop the
current scrolling.
|
void |
setContentInset(UIEdgeInsets contentInset)
Sets the distance that the content of the scroll view is inset inside of
the scroll view (expressed in points).
|
void |
setContentOffset(CGPoint offset)
Moves this UIScrollView according to the specified offset.
|
void |
setContentOffset(CGPoint offset,
boolean animated)
Moves this UIScrollView according to the specified offset using optional
animation.
|
void |
setContentSize(CGSize contentSize)
Sets the size of the content view.
|
void |
setDecelerationRate(double decelerationRate)
Sets the deceleration rate after the finger is lifted.
|
void |
setDelaysContentTouches(boolean delaysContentTouches)
Sets a Boolean that defines whether the scrolling view handles scrolling
gestures with a delay.
|
void |
setDelegate(UIScrollViewDelegate delegate)
Sets the delegate for this scroll view.
|
void |
setDirectionalLockEnabled(boolean directionalLockEnabled)
Sets a Boolean that defines whether the scrolling is permitted only for
one direction.
|
void |
setIndicatorStyle(int indicatorStyle)
Sets the style of the indicator.
|
void |
setPagingEnabled(boolean pagingEnabled)
Sets a Boolean that defines whether paging is enabled.
|
void |
setScrollEnabled(boolean scrollEnabled)
Sets a Boolean that defines whether scrolling is enabled.
|
void |
setScrollIndicatorInsets(UIEdgeInsets scrollIndicatorInsets)
Sets the distance of the scroll indicator from the edges of the view.
|
void |
setScrollsToTop(boolean scrollsToTop)
Sets a Boolean that defines whether the scroll view moves to the top
after a tap on the status bar.
|
void |
setShowsHorizontalScrollIndicator(boolean showsHorizontalScrollIndicator)
Sets a Boolean that defines whether the horizontal indicator is visible.
|
void |
setShowsVerticalScrollIndicator(boolean showsVerticalScrollIndicator)
Sets a Boolean that defines whether the vertical indicator is visible.
|
boolean |
showsHorizontalScrollIndicator()
Returns a Boolean that shows whether the horizontal indicator is visible.
|
boolean |
showsVerticalScrollIndicator()
Returns a Boolean that shows whether the vertical indicator is visible.
|
void |
touchesBegan(Set<UITouch> touches,
UIEvent event)
Sent to this responder when one or more fingers touched the screen.
|
void |
touchesCancelled(Set<UITouch> touches,
UIEvent event)
Sent to this responder when touch event has been canceled.
|
void |
touchesEnded(Set<UITouch> touches,
UIEvent event)
Sent to this responder when one or more fingers were lifted from the
screen.
|
void |
touchesMoved(Set<UITouch> touches,
UIEvent event)
Sent to this responder when one or more fingers move on the screen.
|
boolean |
touchesShouldBegin(Set<UITouch> touches,
UIEvent event,
UIView contentView)
It is used by subclasses in order to customize the behavior of a touch.
|
boolean |
touchesShouldCancelInContentView(UIView view)
Returns a Boolean that shows whether touches on the content subview are
canceled so that dragging starts.
|
accessibilityIdentifier, addConstraints, addGestureRecognizer, addLayoutGuide, addSubview, alpha, animateWithDuration, animateWithDuration, animateWithDuration, areAnimationsEnabled, autoresizesSubviews, autoresizingMask, backgroundColor, bottomAnchor, bounds, bringSubviewToFront, center, centerXAnchor, centerYAnchor, clipsToBounds, contentCompressionResistancePriorityForAxis, contentHuggingPriorityForAxis, contentMode, convertPointFromView, convertPointToView, convertRectFromView, convertRectToView, didAddSubview, didMoveToSuperview, didMoveToWindow, drawRect, frame, gestureRecognizers, heightAnchor, insertSubview, insetsLayoutMarginsFromSafeArea, intrinsicContentSize, invalidateIntrinsicContentSize, isHidden, isMultipleTouchEnabled, isOpaque, isUserInteractionEnabled, layer, layoutIfNeeded, layoutMargins, layoutMarginsDidChange, layoutMarginsGuide, layoutSubviews, leadingAnchor, leftAnchor, maskView, needsUpdateConstraints, nextResponder, overrideUserInterfaceStyle, pointInside, preservesSuperviewLayoutMargins, removeConstraint, removeConstraints, removeFromSuperview, removeGestureRecognizer, removeLayoutGuide, requiresConstraintBasedLayout, restorationIdentifier, rightAnchor, safeAreaInsets, safeAreaLayoutGuide, sendSubviewToBack, setAccessibilityIdentifier, setAlpha, setAnimationBeginsFromCurrentState, setAnimationCurve, setAnimationDelay, setAnimationDuration, setAnimationRepeatAutoreverses, setAnimationRepeatCount, setAnimationsEnabled, setAnimationStartDate, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setCenter, setClearsContextBeforeDrawing, setClipsToBounds, setContentCompressionResistancePriority, setContentHuggingPriority, setContentMode, setFrame, setGestureRecognizers, setHidden, setInsetsLayoutMarginsFromSafeArea, setLayoutMargins, setMaskView, setMultipleTouchEnabled, setNeedsDisplay, setNeedsLayout, setNeedsUpdateConstraints, setOpaque, setOverrideUserInterfaceStyle, setPreservesSuperviewLayoutMargins, setRestorationIdentifier, setTag, setTintAdjustmentMode, setTintColor, setTransform, setTranslatesAutoresizingMaskIntoConstraints, setUserInteractionEnabled, sizeThatFits, sizeToFit, subviews, superview, tag, tintAdjustmentMode, tintColor, tintColorDidChange, topAnchor, toString, trailingAnchor, transform, transitionWithView, translatesAutoresizingMaskIntoConstraints, updateConstraints, updateConstraintsIfNeeded, userInterfaceLayoutDirection, viewForFirstBaselineLayout, viewForLastBaselineLayout, widthAnchor, willMoveToSuperview, willMoveToWindow, willRemoveSubview, windowbecomeFirstResponder, isFirstResponder, resignFirstResponderaddObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKeypublic UIScrollView()
public UIScrollView(CGRect frame)
frame - CGRect that defines dimension and position of the
UIScrollView.public void touchesBegan(Set<UITouch> touches, UIEvent event)
UIRespondertouchesBegan in class UIRespondertouches - The set touches to which the touch or touches belongs.event - The event to which the touches belong.public void touchesEnded(Set<UITouch> touches, UIEvent event)
UIRespondertouchesEnded in class UIRespondertouches - The set touches to which the touch or touches belongs.event - The event to which the touches belong.public void touchesCancelled(Set<UITouch> touches, UIEvent event)
UIRespondertouchesCancelled in class UIRespondertouches - The set touches to which the touch belongs.event - The event to which the touches belong.public void touchesMoved(Set<UITouch> touches, UIEvent event)
UIRespondertouchesMoved in class UIRespondertouches - The set touches to which the touch or touches belongs.event - The event to which the touches belong.public UIView hitTest(CGPoint point, UIEvent event)
UIViewpublic boolean touchesShouldBegin(Set<UITouch> touches, UIEvent event, UIView contentView)
touches - The set of UITouch instances that consist the touching
phase.event - The event to which the UITouch instances belong.contentView - The subview within which the gesture occurred.public boolean touchesShouldCancelInContentView(UIView view)
view - The view that was touched.public CGSize contentSize()
public void setContentSize(CGSize contentSize)
contentSize - The size of the content view.public void setContentOffset(CGPoint offset)
offset - The offset from the original content view position.public void setContentOffset(CGPoint offset, boolean animated)
offset - The offset from the original content view position.animated - TRUE use animation for the change.public CGPoint contentOffset()
public UIEdgeInsets contentInset()
public void setContentInset(UIEdgeInsets contentInset)
contentInset - The distance that the content of the scroll view is
inset inside of the scroll view
inset inside of the scroll viewpublic boolean isScrollEnabled()
public void setScrollEnabled(boolean scrollEnabled)
scrollEnabled - A Boolean that defines whether scrolling is enabled.public boolean isPagingEnabled()
public void setPagingEnabled(boolean pagingEnabled)
pagingEnabled - A Boolean that defines whether paging is enabled.public UIScrollViewDelegate delegate()
public void setDelegate(UIScrollViewDelegate delegate)
delegate - The delegate for this scroll view.public boolean scrollsToTop()
public void setScrollsToTop(boolean scrollsToTop)
scrollsToTop - TRUE then the scroll view moves to the top after a
tap on the status bar.public boolean showsHorizontalScrollIndicator()
public void setShowsHorizontalScrollIndicator(boolean showsHorizontalScrollIndicator)
showsHorizontalScrollIndicator - TRUE the horizontal indicator is
visible only when tracking.public boolean showsVerticalScrollIndicator()
public void setShowsVerticalScrollIndicator(boolean showsVerticalScrollIndicator)
showsVerticalScrollIndicator - TRUE the vertical indicator is
visible only when tracking.public boolean isDecelerating()
public boolean isDragging()
public boolean isTracking()
public boolean alwaysBounceHorizontal()
public void setAlwaysBounceHorizontal(boolean alwaysBounceHorizontal)
alwaysBounceHorizontal - A Boolean that defines whether there is
bouncing of the content when horizontal scrolling reaches the bounds of
the content.public boolean alwaysBounceVertical()
public void setAlwaysBounceVertical(boolean alwaysBounceVertical)
alwaysBounceVertical - A Boolean that defines whether there is
bouncing of the content when vertical scrolling reaches the bounds of the
content.public boolean canCancelContentTouches()
public void setCanCancelContentTouches(boolean canCancelContentTouches)
canCancelContentTouches - FALSE then a scrolling touch on a subview
is ignored(when the view is not scrolling) or stops the current
scrolling.public boolean delaysContentTouches()
public void setDelaysContentTouches(boolean delaysContentTouches)
delaysContentTouches - TRUE then the scrolling view handles
scrolling gestures with a delay.public boolean isDirectionalLockEnabled()
public void setDirectionalLockEnabled(boolean directionalLockEnabled)
directionalLockEnabled - A Boolean that defines whether the
scrolling is permitted only for one direction.public UIEdgeInsets scrollIndicatorInsets()
public void setScrollIndicatorInsets(UIEdgeInsets scrollIndicatorInsets)
scrollIndicatorInsets - The distance of the scroll indicator from
the edges of the view.public double decelerationRate()
public void setDecelerationRate(double decelerationRate)
decelerationRate - The deceleration rate after the finger is lifted.public int indicatorStyle()
public void setIndicatorStyle(int indicatorStyle)
indicatorStyle - The style of the indicator.public boolean bounces()
public void setBounces(boolean bounces)
bounces - A Boolean that defines whether the scroll view bounces
when it reaches the edge boundary.public void scrollRectToVisible(CGRect rect, boolean animated)
rect - The area that scrolled to be visible.animated - TRUE the scrolling is animated.public void flashScrollIndicators()
public void addConstraint(NSLayoutConstraint constraint)
UIViewaddConstraint in class UIViewconstraint - The constraint to be added to the view.public List<NSLayoutConstraint> constraints()
UIViewconstraints in class UIViewNSLayoutConstraintCopyright © 2020. All rights reserved.