UIScrollView attribute summary, uiscrollview Summary

Source: Internet
Author: User

UIScrollView attribute summary, uiscrollview Summary

Properties

AlwaysBounceHorizontal // a Boolean value that determines whether bounce always occurs when horizontal scrolling reaches the end of the content. The default value is NO.

@ Property (nonatomic) BOOL alwaysBounceHorizontal // if this attribute is set to YES and the bounces value is YES, horizontal drag is allowed, even if it is less than the border of the scroll view. The default value is NO.

AlwaysBounceVertical // a Boolean value that determines whether the bounce always occurs when the vertical scroll reaches the end content. The default value is NO.

@ Property (nonatomic) BOOL alwaysBounceVertical // if this property is set to YES and the bounces value is YES, vertical drag is allowed, even if it is less than the border of the scroll view. The default value is NO.

Bounces // determines whether the scroll view is directed back to the edge of the past content, and then returns a Boolean value.

@ Property (nonatomic) BOOL bounces // The default value is YES.

BouncesZoom // a Boolean value that determines whether to scroll the view to push the content Zoom when the zoom exceeds the upper limit or lower limit.

@ Property (nonatomic) BOOL bouncesZoom // if the value of this attribute is YES and the zoom limit or lower limit is exceeded, the system returns the temporary zoom content of the original scrolling view. If this attribute is NO, immediately stop scaling in a proportional limit. The default value is YES.

Cancancancelcontenttouches // a Boolean value that controls whether the involved content view always leads to tracking.

@ Property (nonatomic) BOOL cancancancelcontenttouches

ContentInset // The distance from the content view, which is an illustration from the closed scrolling view.

@ Property (nonatomic) UIEdgeInsets contentInset // use this property to add content to the surrounding scrolling area. The unit of size is vertex. The default value is UIEdgeInsetsZero.

// The Origin of the content view at which point is to monitor the current rolling position from the origin offset of the rolling View
@ Property (nonatomic) CGPoint contentOffset // The default value is CGPointZero.

ContentSize // the size of the content view.

@ Property (nonatomic) CGSize contentSize // The unit of size is vertex. The default value is CGSizeZero.

Decelerating // whether the returned content is in the scrolling view, the user removes their fingers. (Read-only)

@ Property (nonatomic, readonly, getter = isDecelerating) BOOL decelerating // if the user does not drag the content but the rolling event still occurs, the returned value is YES.

DecelerationRate // a floating point value that determines the deceleration rate after the user removes their fingers.

@ Property (nonatomic) float decelerationRate // The UIScrollViewDecelerationRateNormal and UIScrollViewDecelerationRateFas constants used are the reference points for a reasonable deceleration rate.

DelaysContentTouches // a Boolean value that determines whether to delay the processing of the rolling view touch gesture.

@ Property (nonatomic) BOOL delaysContentTouches // if the value of this attribute is YES, the rolling view delays the processed touch posture until it can be determined

Whether to scroll is an intent. If the value is NO, the rolling view immediately calls touchesShouldBegin: withEvent: inContentView: The default value is YES.

Delegate // The representative of the scroll view object.

@ Property (nonatomic, assign) id delegate // The delegate must adopt the UIScrollViewDelegate protocol. The UIScrollView class calls the delegate method to implement each protocol. It does not retain the delegate.

DirectionalLockEnabled // a Boolean value to determine whether to disable scrolling in a specific direction

@ Property (nonatomic, getter = isDirectionalLockEnabled) BOOL directionalLockEnabled // if this attribute is NO, scrolling is allowed in both the horizontal and vertical directions. If YES, It is performed only in the direction (horizontal or vertical) of the user's first rolling. If the start rolling is in the diagonal direction, it can be rolled in any direction. The default value is NO.

Dragging // a Boolean value that indicates whether the user has started to scroll the content. (Read-only)

@ Property (nonatomic, readonly, getter = isDragging) BOOL dragging/the value of this attribute may take some time or a rolling distance before it is set to YES

IndicatorStyle // the style of the rolling indicator.

@ Property (nonatomic) UIScrollViewIndicatorStyle indicatorStyle // default UIScrollViewIndicatorStyleDefault. For details, see "Scroll Indicator Style"


Describe these constants

MaximumZoomScale // a floating point value specifies the maximum size of the content that can be used to scroll the view.

@ Property (nonatomic) float maximumZoomScale // This value determines how much content can be expanded. It must be greater than the minimum scaling ratio before enabling. The default value is 1.0.

Discussion

MinimumZoomScale floating point value, which specifies the minimum proportional factor that can be applied to the content of the scroll View

@ Property (nonatomic) float minimumZoomScale // This value determines how small content can be scaled. The default value is 1.0.

PagingEnabled // a Boolean value that determines whether to enable paging scroll view.

@ Property (nonatomic, getter = isPagingEnabled) BOOL pagingEnabled // if the value of this attribute is YES, when the user scrolls, the scrolling view stops the boundary of the scrolling view. The default value is NO.

PanGestureRecognizer // Basic Gesture Recognition for Pan gestures. (Read-only)

@ Property (nonatomic, readonly) UIPanGestureRecognizer * panGestureRecognizer // your application accesses this attribute when it wants to be able to more accurately control Pan gesture confirmation through the scroll view.

PinchGestureRecognizer // pinch the Basic Gesture Recognition. (Read-only)

@ Property (nonatomic, readonly) UIPinchGestureRecognizer * pinchGestureRecognizer // when your application accesses this attribute, it wants to be able to control the pinch gesture more accurately through the scroll view.

ScrollEnabled // a Boolean value that determines whether to enable scrolling.

@ Property (nonatomic, getter = isScrollEnabled) BOOL scrollEnabled // if the value of this attribute is YES, scroll is enabled. If it is NO, scroll is disabled. The default value is YES. When scrolling is disabled, the scroll view does not accept touch events and forwards them to the response chain.

ScrollIndicatorInsets // The distance from the scroll indicator to the edge of the scroll view.

@ Property (nonatomic) UIEdgeInsets scrollIndicatorInsets // The default value is UIEdgeInsetsZero.

ScrollsToTop // a Boolean value that controls whether to scroll to the top.

@ Property (nonatomic) BOOL scrollsToTop // when set to YES, the scroll view jumps to the top of the content when this gesture occurs. The default value of this attribute is YES.

ShowsHorizontalScrollIndicator // a Boolean value that controls whether the horizontal scroll indicator is visible.

@ Property (nonatomic) BOOL showsHorizontalScrollIndicator // The default value is YES. The indicator is visible while the tracking is in progress and fades out after the end.

ShowsVerticalScrollIndicator // a Boolean value that controls whether the vertical scroll indicator is visible.

@ Property (nonatomic) BOOL showsVerticalScrollIndicator // The default value is YES. The indicator is visible while the tracking is in progress and fades out after the end.

Tracking // return to determine whether the user has touched the content to trigger the scroll (read-only)

@ Property (nonatomic, readonly, getter = isTracking) BOOL tracking // if the user has touched the content view, it may not be dragged yet. The value of this attribute is YES.

ZoomBouncing // a Boolean value that indicates that the scaling has exceeded the specified receiving range. (Read-only)

@ Property (nonatomic, readonly, getter = isZoomBouncing) BOOL zoomBouncing // the value of this attribute is YES if the scrolling view scales back to the min or Max zoom value; otherwise, the value is NO.

Zooming // a Boolean value indicating whether the content is being enlarged or reduced. (Read-only)

@ Property (nonatomic, readonly, getter = isZooming) BOOL zooming // if the user scales the gesture, otherwise it is not set to YES

ZoomScale // a floating point value that specifies the proportional factor currently used to scroll the View content.

@ Property (nonatomic) float zoomScale // This value determines how much content is being scaled. The default value is 1.0.

 

CGSize contentSize the scroll range size

Position of the UIEdgeInsets contentInset view in scrollView

Id <UIScrollerViewDelegate> SET protocol

BOOL directionalLockEnabled specifies whether the control can only scroll in one direction

BOOL bounces control controls whether the border is rebounded

BOOL alwaysBounceVertical controls whether the border rebounded in the vertical direction

BOOL alwaysBounceHorizontal controls whether the border rebounded in the horizontal direction

BOOL pagingEnabled controls whether the entire page is flipped

BOOL scrollEnabled controls whether the control can scroll

BOOL showsHorizontalScrollIndicator controls whether to display a horizontal scroll bar

BOOL showsVerticalScrollIndicator controls whether to display a scroll bar in the vertical direction

UIEdgeInsets scrollIndicatorInsets specifies the position of the scroll bar in scrollerView.

UIScrollViewIndicatorStyle indicatorStyle

Float decelerationRate changes the position of the scrollerView's deceleration point

BOOL tracking monitors whether the current target is being tracked

BOOL dragging: monitor whether the current target is being dragged

BOOL decelerating: monitor whether the current target is slowing down

BOOL delaysContentTouches controls whether the view delays calling the method to Start scrolling.

Whether the BOOL canCancelContentTouches Control controls the touch cancellation event

Minimum float minimumZoomScale scale down

Float maximumZoomScale

Float zoomScale

BOOL bouncesZoom: determines whether it will rebound when controlling Scaling

BOOL zooming determines whether the control size is changing

BOOL zoomBouncing

BOOL scrollsToTop control controls scroll to the top

 

Here we will summarize several key points of UIScrollView:

Starting from your finger touch screen, scrollView starts a timer. if:

1. If your finger does not have any action within ms, the message will be sent to subView.

2. If your fingers slide significantly within ms (a swipe action), the scrollView will scroll and the message will not be sent to the subView. This is the cause of problem 2.

3. If the finger does not slide within ms, scrollView sends the message to the subView, but then the finger starts to slide. scrollView sends the touchesCancelled message to the subView and starts to scroll.

Observe the tableView situation. hold down a cell first, and the cell starts to be highlighted. Do not open the cell and start to slide. The tableView starts to scroll and the highlight is canceled.

DelaysContentTouches:

This flag is YES by default. The above Ms timer is used. If it is set to NO, the touch event will be passed to the subView immediately without a Ms wait.

Functions of cancelsTouches:

This standard defaults to YES. If it is set to NO, the scroll event will not occur once the message is sent to subView.

 

Instance Methods

FlashScrollIndicators // displays the scroll indicator temporarily.

-(Void) flashScrollIndicators // when you move the scroll View to the front, you should call this method.

ScrollRectToVisible: animated: // scroll the content of a specific area so that it is visible when receiving

-(Void) scrollRectToVisible :( CGRect) rect animated :( BOOL) animated // This method is used to scroll to view the content so that the region defined by rect is only visible within the scroll view. If the region is visible, this method does nothing.

Parameters:

Rect // defines the content view of a rectangle area.

Animated // YES if the scrolling shocould be animated, NO if it shocould be immediate.

SetContentOffset: animated: sets the origin offset of the corresponding receiver from the origin of the content View

-(Void) setContentOffset :( CGPoint) contentOffset animated :( BOOL) animated

Parameters:

ContentOffset // a point offset from the origin of the content View

Animated YES indicates the transition to a new offset at a constant speed, and NO indicates that it will arrive immediately.

SetZoomScale: animated: // a floating point number to specify the current scaling ratio

-(Void) setZoomScale :( float) scale animated :( BOOL) animated // The new value should be between minimumZoomScale and maximumZoomScale.

Parameters:

Scale // The New Value of the scaled content.

Animated // YES pushes the transition to a new scale, NO for immediate transition.

TouchesShouldBegin: withEvent: inContentView: // customize the default behavior. When the finger is touched on the displayed content, it is overwritten by the subclass.

-(BOOL) touchesShouldBegin :( NSSet *) touches withEvent :( UIEvent *) event inContentView :( UIView *) view // The default behavior of UIScrollView is to call the target subview of the UIResponder event processing method of the touch event.

Parameters:

Touches // A UITouch instance set involved indicates the start phase of the event

Event // indicates that the touch object belongs to the event object.

View // a child view with a touch gesture in the content.

Return Value // NO is returned. If you do not want to view the event messages sent by the view. If you want to receive these messages, YES (default) is returned ).

TouchesShouldCancelInContentView: // return whether to cancel the contact of the Child view of the relevant content, and start dragging.

-(BOOL) touchesShouldCancelInContentView :( UIView *) view // this method is called by the dynamic view after it starts to send the content view of the tracking mail. If it receives NO from this method, it stops dragging and forwarding the content subview of the touch event. Scroll view does not call this method if the cancancancelcontenttouches attribute value is NO

Parameters:

View object triggered by view in content

Return Value // YES cancel further touch message view, NO view continues to receive these messages. If the view determines whether a UIControl object is set to YES by default, otherwise NO is returned.

ZoomToRect: animated: // narrow down the content to a specific area, so it is visible in the receiver.

-(Void) zoomToRect :( CGRect) rect animated :( BOOL) animated // zoomScale adjusted in this way to make the content view area defined by the rectangle

Rect // rectangle defines the content view area

Animated // YES if the scrolling shocould be animated, NO if it shocould be immediate.

Constants

Scroll Indicator Style

Typedef enum {// indicator style setting

UIScrollViewIndicatorStyleDefault, // default,

UIScrollViewIndicatorStyleBlack, // applicable to white background

UIScrollViewIndicatorStyleWhite

} UIScrollViewIndicatorStyle;

Deceleration Constants // Deceleration constant

The rate of deceleration for a scrolling view.

{

Const float UIScrollViewDecelerationRateNormal; // default deceleration rate

Const float UIScrollViewDecelerationRateFast;

}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.