Ios-ui-uiscrollview scrolling View (1)

Source: Internet
Author: User

Scrolling view the principle of multi-page implementation the position of the scroll view position changes when the content is unchanged.

Application of Scrolling view 1. View the picture by paging 2. See the big picture 3. When too much content needs a page display, such as: registration, modify personal information and so on 4. When you don't want the user to feel that our interface is a picture ...

When you set the contentsize of a scrolling view, contentsize is not scrolled if the bounds is smaller than the scroll view

Setting the contentsize of a scrolling view is the same as the size of the picture

Scrollview.contentsize =bgimg.size;

Add a picture on a scrolling view (add content on a scrolling view)

Imgview =[[uiimageview alloc]initwithframe:cgrectmake (0, 0, Bgimg.size.width, bgimg.size.height)];

Imgview.image = bgimg;

[ScrollView Addsubview:imgview];

Add ScrollView to Self.view and run the simulator to see the big picture.

2. When we need to zoom in and out of large images

Set the zoom multiplier of a scrolling view

Scrollview.minimumzoomscale = 0.5;

Scrollview.maximumzoomscale = 2;

Use the agent method of scrolling view, need to hang up agent

Scrollview.delegate =self;

Set up a view that needs to be enlarged in a scrolling view

-(UIView *) Viewforzoominginscrollview: (Uiscrollview *) scrollview{

return imgview;

}

Note: You do not need to initialize the window in the appdelegate when writing the above code.

Import Agent:

Ios-ui-uiscrollview scrolling View (1)

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.