masonry布局說明

2022-06-27 21:33:11 字數 601 閱讀 7769

這個要根據情況而定,有時會很有用的。

個人例項:

//

左側輸入框右側按鈕按鈕變長有限制最小寬度,保持輸入框與按鈕左側距離,設定按鈕的壓縮性強(即一般不被拉伸)輸入框拉伸性強容易拉伸

[self.button mas_makeconstraints:^(masconstraintmaker *make) ];

[self.button setcontenthuggingpriority:uilayoutprioritydefaulthigh foraxis:uilayoutconstraintaxishorizontal];

[self.textfield mas_makeconstraints:^(masconstraintmaker *make) ];

[self.textfield setcontentcompressionresistancepriority:uilayoutprioritydefaulthigh foraxis:uilayoutconstraintaxishorizontal];

圖示:

自動布局Masonry

通過cocoapod新增masonry三方,或者手動新增三方 建立乙個view uiview view uiview new view.backgroundcolor uicolor purplecolor self view addsubview view 300 300 居中顯示的矩形 view...

masonry 瀑布流布局外掛程式使用說明

引數名 引數說明 itemselector class選擇器,預設 item columnwidth 一列的寬度 isanimated 使用jquery的布局變化,預設true animationoptions animate屬性漸變效果 object gutterwidth 列的間隙 intege...

Masonry布局控制項,自動換行

masonry偏移量offset答疑 make.top.equalto self.view offset 10 make.left.equalto self.view offset 10 make.bottom.equalto self.view offset 10 make.right.equal...