Explanation of Position+anchorpoint and frame application in iOS development

Source: Internet
Author: User

I was very confused about these two places at first, so let's explain their connections now. 1/position and Anchorpoint are a pair of properties that are often set together to determine the position of the control frame individually set 2/position to the upper-left corner of the parent control as (0, 0), with unlimited values. The Anchorpoint is in its own upper-left corner (0, 0), and is valued at 0-1. Frame is 0 points in the upper-left corner of the parent control and has no limit. 3/position and Anchorpoint must coincide, anchorpoint default is (0.5, 0.5), Position indeterminate 4/When we have fixed the position of frame, say frame = (100,100,200,200). Then the position and Anchorpoint are also determined, how much is it? Anchorpoint default is (0.5, 0.5), because it must be coincident, so the position point for (200, 200) can be. See, With Anchorpoint and frame, position can be determined. 5/After the frame has been fixed and modified, the control will be moved again, that is, it is not said that after the frame has been written, the control is completely determined. 6/Generally, position and anchorpoint, modify one, the control will change with the run position, (200, 200), which is equivalent to changing the coordinate system (x, Y), but the value of Anchorpoint Does not change the anchorpoint, (0.5, 0.5)--(1, 1), which is relative to the original position, the top left to move 50% respectively, but the value of position will not change, modify one side, the control position is definitely to become

Position+anchorpoint and Frame application in iOS development

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.