The bounce attribute of scrollview in ios and clipsTobounds attribute in view, clipstobounds

Source: Internet
Author: User

The bounce attribute of scrollview in ios and clipsTobounds attribute in view, clipstobounds

I. bounce attribute of scrollview

When scrollview scrolls to the boundary, it will have a bounce effect. The bounce attribute exists in scrollview. If it is set to yes, it will rebound. If it is set to NO, it will not rebound. Could you tell me, can we make it rebound with only one boundary? This function can be used to achieve continuous sliding by adding tableview and scrollview to a scrollview, that is, when the table slides to the end, the scrollview under the scrollview slides.

Ii. clipsTobounds attribute in view

Iew2 adds view1 to. If view2 is greater than view1, or view2 is not in the range of view1, view2 is covered by view1, which means that the excess part will be drawn.

UIView has an attribute. clipsTobounds is NO by default.
If we want view2 to hide the excess part, we have to change its parent View to the clipsTobounds attribute value of view1.
View1.clipsTobounds = YES;

It can effectively solve the coverage problem.

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.