简单的堆栈布局视图拉伸基于NNStackViewOrientation子视图(水平或垂直).
Demo
Build and run the project in Xcode to see NNStackView
in action. App Delegate loads the DemoViewController
Example Usage
NNStackView *stackView = [[NNStackView alloc] initWithFrame:frame]; // Or bind the view to outlet [stackView add:view]; // Adding sub view [stackView updateOrientationTo:NNStackViewOrientationHorizontal]; // Updates the orientation [stackView removeLastView]; // Removes the last added view NNStackViewMargin margin* = [NNStackViewMargin create:10 right:10 top:20 bottom:20 between:10]; stackView.margin = margin; // Sets the margin, currently requires additional updateViewPositions call ... [stackView updateViewPositions]; // Refreshes the stack view sub views