简体   繁体   中英

Xcode pin menu for adding Auto Layout constraints is missing

In other projects, the menu is not missing. However, in one project I cannot see or find the menu. Does anyone know how to make it reappear? I could not find here or via Google or in the Apple docs, but perhaps I am not looking in the right place. I am using v6.1, if that matters.

Many thanks!

Select the Storyboard file in the navigator, open the utilities menu on the top right, show the file inspector (the left icon) and under the Interface Builder Document menu, click Use Auto Layout.

Regards

At the bottom-right corner of canvas view there are some icons, one of them is the new pin menu. Use it

Pin in storyboard

In case anyone has this problem: the one piece of information is missing from the otherwise correct answers - these icons are in the lower RIGHT corner. As such, if you don't have your storyboard view wide enough you won't get them - you have to increase the size of the view then you will see them.

Verified in Xcode 8.3 Swift 3 There is a possibility that Autolayout was disabled while creating the project. Select Main.storyboard, In the right menu that has "File Inspector", under the section 'Interface Builder Document', enable 'Use Auto Layout'. The pin menu comes up at the usual place - bottom right corner

First select the LaunchScreen.storyboard:

Second select the parents view:

Third go to the file inspector:

Fourth chick the use auto layout:

I got the same problem, and was looking for a solution. I tried many options, but what really solved it, was closing the project and reopening it again (the same project, not a new one).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM