簡單的堆棧布局視圖拉伸子視圖:NNStackView

jopen 10年前發布 | 14K 次閱讀 iOS開發 移動開發 NNStackView

簡單的堆棧布局視圖拉伸基于NNStackViewOrientation子視圖(水平或垂直).
image.jpg

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

項目主頁:http://www.baiduhome.net/lib/view/home/1416984790346

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!