IOS Uiscrollview Learning Record

Source: Internet
Author: User

    1. Property:

(1) The Contentsize property must be specified, and the actual size of the content must be so that scrolling the view knows the range of scrolling.

(2) turning on the zoom function requires adjusting the view's two properties, namely Maxinumzoomscale and Mininumzoomscale .

This allows the user to resize the content using a pinch gesture.

(3)Contentoffset

a Cgpoint structure that contains the offset to display content relative to the upper-left corner of the window. The default is to start with 0x0

, but you can put the display in a different location by using the Setcontentoffset method.

(4)Indicatorstyle

Specifies the type of scroll bar indicator you want to use. The default behavior is to draw a black scroll bar on the white border, which in large

Applicable in most contexts. Available styles are as follows:

                  1.  Uiscrollviewindicatorstyledefault  

2. Uiscrollviewindicatorstyleblack
3. Uiscrollviewindicatorstylewhite

(5)bounces

When the user arrives at the edge of the scrolling area, this feature allows the user to drag a little outside the boundary. When the user releases the finger

, the area will bounce back like a rubber band, giving the user a visible hint that he has reached

The start or end position of the document. If you do not want the user's scrolling range to exceed the visible content, you can set this property

is No.

(6) Bounceszoom

Similar to the bounces option, this method allows the user's zoom operation to exceed the maximum or minimum zoom level and then bounce back

Within the range. If you do not want the user to be able to scale beyond the range you specify, set this property to No.

(7) pagingenabled
When paging is turned on, the scrolling view is split into separate sections, and the two user's scrolling experience becomes a page flip

You can use this property to flip the page.


2. Delegation Method

You can assign a delegate to a scrolling view, and the following delegate method will receive a notification at a specific time.

(1)-(void) Scrollviewdidscroll: (uiscrollview*) ScrollView;

Receive a notification when the view scrolls. Includes a pointer to the scrolled view from which you can read the Contentoffset property to confirm

the location to which to scroll.        

(2)-(void) scrollviewwillbegindragging: (uiscrollview*) ScrollView;

Be notified when the user first drags in a direction. This method gets the scroll view pointer passed as a parameter, and the Contentoffset property can also be read from.

(3)-(void) scrollviewdidenddragging: (uiscrollview*) ScrollView willdecelerate: (BOOL) decelerate;

get notified when the user is lifted up and dragged to the finger.  You will also get a Boolean value that is known to report the need to decelerate before scrolling the last position of the view .

(4)-(void) Scrollviewwillbegindecelerate: (uiscrollview*) ScrollView;

A notification is received when the user lifts his finger and the view needs to move on. This method can be used to read the Contentoffset property,

Thus judging the position of the last scroll when the user lifts the finger money, although this position does not make the final stop bit of the scroll bar

Reset

(5)-(void) scrollviewdidenddecelerating: (uiscrollview*) ScrollView;

Be notified when the above mentioned deceleration is complete and the scrolling view is stopped. When you receive this notification, scroll the view's

The Contentoffset property reflects where the scroll bar eventually stops.

(6)-(void) scrollviewdidendzooming: (uiscrollview*) ScrollView Withview: (uiview*) view

Atscale: (float) scale;

When users zoom in on content, they receive a notification. The scale is expressed as a floating-point value, which is passed in as a parameter.

(7)-(BOOL) Scrollviewshouldscrolltotop: (uiscrollview*) ScrollView;
(8)-(void) Scrollviewdidscrolltotop: (uiscrollview*) ScrollView;
When the user points out the iphone status bar, scrolling the view delegate can determine whether the view scrolls back to the beginning.


This article is from the "Sheep" blog, please make sure to keep this source http://5934497.blog.51cto.com/5924497/1636354

IOS Uiscrollview Learning Record

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.