IOS9 programming GOGOGO: New Change of XCode7, ios9xcode7
Create a Demo about stack view UIStackView. First, let's take a look at the changes in XCode7.
About StoryBoard:
The boot screen changes from xib to Storyboard.
StoryBoard reference:
Now you can add a reference to another StoryBoard in one StoryBoard. You do not need to write code when switching between multiple SB instances,
Previous method (SWIFT ):
override func viewDidLoad() { super.viewDidLoad() var sb : UIStoryboard let del = UIApplication.sharedApplication().delegate as! AppDelegate sb = UIStoryboard(name: "LaunchScreen", bundle: nil) del.window?.rootViewController = sb.instantiateInitialViewController() }
Now drag the corresponding action to the StoryBoard Reference you want to jump.
Stack View:
1. Drag some controls:
2. select these controls and click the new button on the left of the autolayout button group. stack!
3. They are combined into a vertical stack view (P.S. Stack view can only be either horizontal or vertical)
4. Modify the Axis of the stack view to a horizontal one to see the effect:
5. In this way, the spacing between controls does not come out. We modify the distribution attribute and change it from Fill to equal spacing. Then we give a value of 20, and the controls are automatically hashed to the entire stack view at a distance of 20.
6. You can also define the alignment mode, such as vertical stack and left alignment. effect:
7. Create a socket for this stack view to see how to use code to operate its subview:
8. obtain its subview through the arrangedSubview attribute and return an ordered view array:
9. Take the 1 subscript of the array, and the slider is used to change its value to 0.9. Then, the system will slide to the 90% position after running:
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.