Frame,bound,center for iOS

Source: Internet
Author: User

Frame: Refers to the size and position of the view in the coordinate system of the parent view.

Bound: Refers to the size of the view in the coordinate system of the attempt itself (the origin of the position is the original point). Center: Refers to the point at which the view is centered in the parent view coordinate system. A picture of the Apple website: frame and bound relationshipHere is one of the changes , the remaining two changes, see directly, very superficial.  

Although you can change the frame , bounds , and center Properties independent of the others, changes to one property affect T He others in the following ways:

    • When you set the  frame  property, the size of value in the  bounds  property changes to match the new size of the frame rectangle. The value in the  Center  property similarly changes to match the new center point of the frame recta Ngle.

    • When you set the  Center  property, the origin value in the  frame   Changes accordingly.

    • When you set the size of the  bounds  property, the size value in the  frame  property changes to match the new size of the bounds rectangle.

By default, a view's frame is not clipped to its superview ' s frame. Thus, any subviews that lie outside of their superview ' s frame is rendered in their entirety. You can change this behavior, though, by setting the Superview ' s  clipstobounds  property to < Code>yes . Regardless of whether or not subviews is clipped visually, touch events always respect the bounds rectangle of the target View ' s Superview. In other words, touch events occurring in a part of a view the lies outside of its Superview ' s bounds rectangle is not D Elivered to that view.

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.