Talking about Uiscrollview

Source: Internet
Author: User

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

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.