UIScrollView, used by uiscrollview

Source: Internet
Author: User

UIScrollView, used by uiscrollview

Knowledge point:

1) UIScrollView

2) UIPageControl

========================================================== ====================

 

I. UIScrollView

 

1. Introduction to UIScrollView

A scrollable view is generally used for album browsing, advertising, guiding image launched for the first time by the app, or multi-screen scrolling.

 

2. Common attributes and Methods

1) contentSize: Scroll area. The scroll area must be greater than the width and height of scrollView to scroll.

2) showsHorizontalScrollIndicator horizontal scroll bar

3) showsVerticalScrollIndicator vertical scroll bar

4) directionalLockEnabled locking method

5) scrollsToTop automatically slides to the top when you click the status bar.

6) pagingEnabled slides one screen at a time.

7) bounces drag borders

8) delegate proxy

9) contentOffset offset, used to determine the number of screens to scroll

 

When navigation is available, you need to use automaticallyAdjustsScrollViewInsets to adjust the scroll area of the ScrollView. When NO is available, the ScrollView starts from the top of the screen, that is, it is overwritten by the status bar and navigation bar; if YES, it is the default action. When sliding up or down, the navigation bar and status bar can be penetrated.

The difference between edgesForExtendedLayout and edgesForExtendedLayout can penetrate the navigation bar and status bar.

(The differences between the two are described in detail in the previous blog)

 

3. UIScrollView proxy

// As long as the scrollView slide process is called

-(Void) scrollViewDidScroll :( UIScrollView *) scrollView

// Called when scrollView starts dragging

-(Void) scrollViewWillBeginDragging :( UIScrollView *) scrollView

// Called when stopping or slowing down

-(Void) scrollViewDidEndDecelerating :( UIScrollView *) scrollView

There are many more. Let's take a look at them.

 

4. Sometimes it works with the timer to enable scrollView to automatically rotate

========================================================== ====================

 

Ii. UIPageControl

 

1. Introduction to UIPageControl

Paging indicator, used in combination with ScrollView

 

2. Common attributes and Methods

1) numberOfPages indicates the number of points

2) the number of points selected by default in currentPage settings

3) hidesForSinglePage hides the control when there is only one point.

4) color of all pageIndicatorTintColor points

5) currentPageIndicatorTintColor color of the current vertex

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.