在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:nsomar/OAStackView开源软件地址:https://github.com/nsomar/OAStackView开源编程语言:Objective-C 99.0%开源软件介绍:OAStackViewiOS 9 introduced the very cool UIStackView, UIStackView can be used to easily create simple and complex layouts. As expected
UsageTo run the example project, clone the repo, and run Since
Interface BuilderDrag a a UIView into your view controller, and add some views to it. Change the class to (Optional) Change the stack Axis (set Axis Value to 0 for Horizontal or 1 for Vertical), Spacing, Alignment or distribution. Run the project! From CodeTo use As a quick example on its usage do the following: Create a couple of views to be stacked: UILabel *l1 = [[UILabel alloc] init];
l1.text = @"Label 1";
UILabel *l2 = [[UILabel alloc] init];
l2.text = @"Label 2"; Create the stack view passing the array of views: OAStackView *stackView = [[OAStackView alloc] initWithArrangedSubviews:@[l1, l2]];
stackView.translatesAutoresizingMaskIntoConstraints = NO; Add the stack view to [self.view addSubview:stackView];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-30-[stackView]"
options:0
metrics:0
views:NSDictionaryOfVariableBindings(stackView)]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-10-[stackView]"
options:0
metrics:0
views:NSDictionaryOfVariableBindings(stackView)]]; InstallationOAStackView is available through CocoaPods. To install it, simply add the following line to your Podfile: pod "OAStackView" TestsSince The following a human readable text subscript (generated with specipy). ContributionAll contributions in any form are welcomed, if you find the project helpful, and you want to contribute then please do. Known Issues, and future improvementsMissing functionality
Please refer to UIStackView for proper documentation. Future improvementsThe following would be nice to have for future versions
AuthorOmar Abdelhafith, [email protected] LicenseOAStackView is available under the MIT license. See the LICENSE file for more info. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论