测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布上次发布 | 2017年10月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Gürhan Yelikaya 维护。
可滚动的 UIStackView。用微笑滚动您的视图助手。使用 Swift 3 编写。使用 Apple 的纯自动布局。如果您需要使用可滚动的 UIStackView(类似于 UIScrollView),这是正确的库。Objective-C 和 Swift 兼容。
要安装它,只需在 Podfile 中添加以下行
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'TargetName' do
pod "ScrollableStackView"
end
然后,运行以下命令
$ pod install
import ScrollableStackView
var scrollable = ScrollableStackView(frame: view.frame)
view.addSubview(scrollable)
// add your views with
let rectangle = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 55))
rectangle.backgroundColor = UIColor.blue
scrollable.stackView.addArrangedSubview(rectangle)
// ...
@import ScrollableStackView
ScrollableStackView *scrollable = [[ScrollableStackView alloc] initWithFrame:self.view.frame];
scrollable.stackView.distribution = UIStackViewDistributionFillProportionally;
scrollable.stackView.alignment = UIStackViewAlignmentCenter;
scrollable.stackView.axis = UILayoutConstraintAxisVertical;
[self.view addSubview:scrollable];
UIView *rectangle = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 55)];
[rectangle setBackgroundColor:[UIColor blueColor]];
// add your views with
[scrollable.stackView addArrangedSubview:rectangle];
// ...
Cocoapods 要运行示例项目,请克隆仓库,并在 Example 目录中首先运行
$ pod install
。
如果您想改善此项目的方式
推荐遵循 GitHub Swift 风格指南
谢谢!
Gürhan Yerlikaya, [email protected]
ScrollableStackView 可在 MIT 许可协议下使用。有关更多信息,请参阅 LICENSE
文件。