How uiscrollview is displayed in iOS development UI

Source: Internet
Author: User

 

Uiscrollview principle post: http://www.cocoachina.com/bbs/read.php? Tid = 40965
// Author: strong iPhone development license ****: 79190809 mailbox: zhuolaiqiang@gmail.com post please keep in the rolling process, in fact, is modifying the origin coordinates

When the finger is touched, scroll view will temporarily intercept the touchEvent, Use
Timer. If no finger movement event occurs after the timer reaches the point,
Then, scroll view sends tracking events to the clicked subview
If a moving event occurs before the timer arrives, scroll view cancels tracking.
Rolling by yourself

The subclass can overload touchesshouldbegin: withevent: incontentview: determines whether to receive touch events.
The value of pagingenabled is yes, yesAutomaticScroll to the subview boundary. The default value is no.
Touchesshouldcancelincontentview: When the tracking messages message is sent to the subview
Call this method to determine whether to send the tracking messages Message to the subview. If no is returned, send, yes is not sent.
If the cancancancelcontenttouches attribute is no, this method is not called.
To influence how to handle rolling gestures

Scroll view also handles scaling and shifting gestures
To achieve scaling and shifting, you must delegate viewforzoominginscrollview:
Scrollviewdidendzooming: withview: atscale:
The maximumzoomscale and minimumzoomscale attributes must be different.

Several attributes
Tracking
When the touch is not dragged, the value is yes; otherwise, no

Zoombouncing
If the content is enlarged to the maximum or minimum, the value is yes; otherwise, no

Zooming
When scaling, the value is yes; otherwise, no

Decelerating

When the scroll occurs, the finger is opened, but the scroll continues. This is yes, and the other is no.

Decelerationrate

Set the deceleration rate after the finger is released

Maximumzoomscale
A floating point number, indicating a multiple of the maximum allowed values

Minimumzoomscale
A floating point number, indicating the smallest possible multiple.

Pagingenabled
If the value is yes, it will automatically scroll to the subview boundary. The default value is no.

Scrollenabled
Determines whether scrolling is allowed.

Delayscontenttouches

It is a Boolean value. When the value is yes, the user starts to touch and the scroll view will be delayed for a while to see if the user intends to scroll. If the scroll is finished, capture the touch-down event, if the value is no, scroll view immediately triggers touchesshouldbegin: withevent: incontentview:. The default value is yes.

Cancancancelcontenttouches
When the value is yes, the user does not move after touching it for a certain period of time,ScrollviewSend tracking events, and then the user moves his finger long enough to trigger the rolling event. At this time, scrollview sends touchescancelled: withevent: To subview, and then scroview starts to scroll.
If the value is no, after scrollview sends tracking events, even if the user moves his finger, scrollview does not scroll.

Contentsize
The size of the content, that is, the size that can be scrolled. The default value is 0, with no scrolling effect.

Showshorizontalscrollindicator
Indicates whether to scrollDisplayHorizontal scroll bar

Showsverticalscrollindicator
Indicates whether a vertical scroll bar is displayed during scrolling.

Bounces
The default value is yes, that is, rolling beyond the boundary will rebound and return. If it is no, rolling to the boundary will be quickly stopped.

Bounceszoom
Similar to bounces, the difference is that this effect is reflected in the scale. If the scale exceeds the maximum scale, it will rebound. If it is no, it will immediately stop when it reaches the maximum or minimum.

Directionallockenabled
The default value is No. It can be moved in both the vertical and horizontal directions. The value is yes. If it is vertical or horizontal at the beginning, the scroll in the other direction will be locked, if you scroll in the diagonal direction at the beginning, a certain direction is not prohibited.

Indicatorstyle
The style of the scroll bar. The color is basically set. The default value is black and white.

Scrollindicatorinsets
Set the position of the scroll bar

 

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.