A picture that lets you know the difference between bounds and frame in iOS

Source: Internet
Author: User
A lot of people are learning to confuse the difference between bounds and frame, you can see this picture will understand the difference between the two: frame: the location and size of the view in the parent view coordinate system. (reference point is, Father's coordinate system)
Bounds: The position and size of the view in the local coordinate system. (The reference point is that the local coordinate system is equivalent to VIEWB's own coordinate system, starting at 0, 0 points)
Center: The position and size of the view's central point in the parent view coordinate system. (reference point is, Father's coordinate system) fancy, if the Viewa bounds is set to ( -200,-100,550,400) then View.frame = (0,0,550,400) view.bounds = (0,0,550,400); Each new view default bounds is actually (0,0,,)
"Viewwithtag is based on the tag to get the view
For example, add a Viewbutton to the view and set his tag to 101.
Then (UIButton *) [ Current View viewwithtag:101] can take you to add the button "

A picture that lets you know the difference between bounds and frame in iOS

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.