在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:tomvanzummeren/TZStackView开源软件地址:https://github.com/tomvanzummeren/TZStackView开源编程语言:Swift 98.7%开源软件介绍:TZStackViewA wonderful layout component called the
Features
So this implementation does not support Storyboard. It is meant for iOS developers who, like me, want to use the SetupYou basically have two options to include the CocoaPodsUseExample source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.0"
use_frameworks!
pod "TZStackView", "1.2.0" Unfortunately, using CocoaPods with a Swift pod requires iOS 8. CarthageUseExample
Run Drag files directly into your projectAlternatively (when you do want to support iOS 7) drag in the following classes from the Example folder directly into your Xcode project
Example usageGiven let stackView = TZStackView(arrangedSubviews: [view1, view2, view3])
stackView.distribution = .FillEqually
stackView.alignment = .Center
stackView.axis = .Vertical
stackView.spacing = 25 This would produce the following layout: See the developer documentation for To animate adding a view to or removing a view from the arranged subviews, simply hide or show them by adjusting the UIView.animateWithDuration(0.5, animations: {
self.view2.hidden = true
}) Migrating to UIStackViewIf at a later point you decide to make iOS 9 the minimum requirement of your app (it will happen sooner or later), you will want to migrate to the real let stackView = TZStackView(arrangedSubviews: views) with ... let stackView = UIStackView(arrangedSubviews: views) ... and you're good to go! You will not need to make any other changes and everything will simply work the way it worked before. LicenseTZStackView is released under the MIT license. See LICENSE for details. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论