Normal. UIView does not have scrolling capability and cannot display too much content . Uiscrollview is a scroll-capable view control that can be used to display a large amount of content and to scroll through all of the content.
if uiscrollview cannot scroll, the following may be the reason:
not set contentsize
scrollenabled = NO
No touch event received : userinteractionenabled =
No cancellations AutoLayout function (to ScrollView scrolling, must be canceled AutoLayout )
Uiscrollviewwill beDelegateThe methods that need to be implemented are defined in theuiscrollviewdelegateagreement, so you want to beUiscrollviewof theDelegate, must abide byuiscrollviewdelegateprotocol, and then implement the corresponding method in the protocol, you can listenUiscrollviewscrolling process.
Common Properties
@property (nonatomic) cgpoint contentoffset ; This property is used to indicate where the Uiscrollview scrolls.
@ Property(nonatomic)cgsizecontentsize; This property is used to indicateUiscrollviewcontent ofdimensions, scroll range (How far you can roll)
@ Property(nonatomic)uiedgeinsetsContentinset; This property can beUiscrollviewof the4Week adds extra scrolling area
@property(nonatomic)BOOLbounces;SetUiscrollviewDo you need a spring effect ?
@property(nonatomic,Getter=isscrollenabled)BOOLscrollenabled; SetUiscrollviewWhether you can scroll
@property (nonatomic) BOOL Showshorizontalscrollindicator; Whether to display the horizontal scroll bar
@property (nonatomic) BOOL Showsverticalscrollindicator ; whether to show vertical scroll bars
As long as the Uiscrollviewof thepageenabledproperty is set toYES,Uiscrollviewwill be divided into separate pages, the contents of which can be paginated displaygenerally will cooperateUipagecontrolenhance the paging effect,UipagecontrolCommon properties are as followsHow many pages are there altogether?
@ Property (nonatomic) Nsinteger numberofpages ;
The page number that is currently displayed
@ Property (nonatomic) Nsinteger currentpage;
Whether you need to hide the page number indicator when there is only one page
@ Property (nonatomic) BOOL Hidesforsinglepage;
Color of other page number indicators
@ Property (nonatomic,retain) Uicolor * Pageindicatortintcolor;
@ Property (nonatomic,retain) Uicolor * Currentpageindicatortintcolor ;
This article from "Love to develop love to create" blog, reproduced please contact the author!
Talking about Uiscrollview