IOS Contentoffset How to understand

Source: Internet
Author: User
Which point is Contentoffset??? First of all, the literal understanding: content Offset I looked up the dictionary!!!

For Contentoffset There are times when we have a wrong understanding. I do not want to introduce the wrong understanding here to avoid unnecessary confusion.

When will we meet Contentoffset???

More often in a rolling attempt, we can implement some methods by combining proxies.

such as Carousel (I'll introduce the implementation of the carousel in the next article as to the code if needed I can sort it out) then please let me explain the contentoffset through a picture demonstration.

A

In Figure one, the green screen is the largest display range is also the scrolling view of the frame, red is the contentsize of the scrolling attempt.

We can interpret two frames as two view. The result is that the top left vertex of the two view is coincident, when the Contentoffset is {0,0}.

Two

In Figure two we shift the red to the left by 100, which is the equivalent of scrolling to the left by 100.
The result is that Contentoffset is {100,0}.

Three

So we can draw the offset of the vertex of the frame vertex relative to the current display area of the ScrollView.

IOS Contentoffset How to understand

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.