Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find stack view button on Xcode

Tags:

xcode

ios

I am studying Xcode from the official apple website and it explain how to merge ui elements with the button "stack view" , I have the latest version of Xcode, but I can't find this button, how I can create a stack view or similar thing?

From the official doc:

enter image description here

like image 921
Rivas202 Avatar asked Jul 06 '15 12:07

Rivas202


People also ask

How do I stack view in Xcode?

Xcode provides two ways to use stack view: You can drag a Stack View (horizontal / vertical) from the Object library, and put it right into the storyboard. You then drag and drop view objects such as labels, buttons, image views into the stack view. Alternatively, you can use the Stack option in the auto layout bar.

How do I use stack view auto layout?

fill. A layout where the stack view resizes its arranged views so that they fill the available space perpendicular to the stack view's axis. The simplest of the alignments, . fill constrains the leading/trailing edges of each arranged subview to the leading/trailing edge of the stack view.

How do I change the stack view height?

'Fill proportionally' distribution type works with intrinsic content size. So if our vertical stack(height say 600) view has 2 views, ViewA (intrinsic content height 200) and ViewB(intrinsic content height 100), the stack view will size them to ViewA(height 400) and ViewB(height 200).


2 Answers

In the first pages of this Tutorial where it seems that you got the image, there is a screenshot with the XCode Logo with a "Beta" sign.

UIStackView are introduced in iOS9. So it can only be used with an XCode that supports iOS9 (currently in Beta): XCode 7 (Beta).

Even if you could use the iOS9 SDK in XCode 6, I think that it wouldn't have the "Stack View" Button. Maybe Apple will give a last update to XCode 6 to supports iOS9, but that is just speculation.

like image 136
Larme Avatar answered Sep 19 '22 04:09

Larme


I am using Xcode 7. and I ran into the same problem and couldn't find the stack button. After I enable "Use Auto Layout" under "Interface Builder Document" section in the Utility View, stack buttons show up. "Use Auto Layout" is enabled by default. Please check if it is enabled.

like image 37
Lei Wang Avatar answered Sep 23 '22 04:09

Lei Wang