IOS9 programming GOGOGO: New Change of XCode7, ios9xcode7

Source: Internet
Author: User

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.

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.