Xcode7, disappear pin menu (Editor-& gt; pin), xcode7editor-

Source: Internet
Author: User

Xcode7, disappear pin menu (Editor-> pin), xcode7editor-

If you have used autolayout, you should be familiar with pin. With this option, you can set the margins around the control: Top Space, Leading Space, Trailing Space, and Bottom Space.

In the Xcode6 era, you can use pin in two ways:

1) menu item: Editor-> pin

2) Click the pin button at the bottom of the designer to display the pin ):

These two methods are slightly different. Using the pin (Editor-> pin) in the menu item, you can directly select Top Space to Superview, that is, directly set the Top margin from superview, if the pin button is used, it selects the margin (not necessarily superview) from the previous view based on the position of the current view, and if it is in navigationcontroller, top Space to Top Layout Guide often appears. I have not figured out what the Top Layout Guide and Bottom Layout Guide are, but generally we only want the view constraints to be related to superview. In this case, I usually Delete the constraints and use Editor-> pin to set Top Space to Superview.

Well, the above are all nonsense. The following is the focus of this article.

I believe many people have upgraded Xcode to Xcode7, and then you will find that no pin is found in the Editor .....

However, if you use the pin button, the Top Space to Top Layout Guide still appears. What if you want to set Top Space to Superview?

After searching for a long time, I finally found the answer on stackoverflow (here Baidu search, except for the old and old data, can't really find valuable information, if you can use google, use google)

The answer is here: http://stackoverflow.com/questions/28766210/autolayout-add-constraint-to-superview-and-not-top-layout-guide

There is a downward arrow on the right of the constraint input box. clicking the arrow will show the selection, as shown in:

See it. Now the "Top Layout Guide" is selected. We only need to select View. The result is Supview. This View indicates the Root view of ViewController. Because this View is directly added to the root View of ViewController, the View here is Superview.

If other controls exist, the options here may be different, but you can understand them at the beginning.

Well, there's so much to talk about. I hope this will help you. If you have any mistakes, please correct them.

Related Article

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.