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