IOS uses masonry to Quickly arrange a group of views in the middle width of the superview, masonrysuperview
Keycode:
/*** Layout several views in the inerview container. ** @ param views viewArray * @ param containerView container view * @ param LRpadding: The left and right margins of the container * @ param viewPadding left and right margins */-(void) summary :( NSArray *) views inView :( UIView *) containerView LRpadding :( CGFloat) LRpadding viewPadding :( CGFloat) viewPadding {UIView * lastView; for (UIView * view in views) {[containerView addSubview: view]; if (lastView) {[view mas_makeConstraints: ^ (MASConstraintMaker * make) {make. top. bottom. similar to (containerView); make. left. similar to (lastView. mas_right ). offset (viewPadding); make. width. failed to (lastView);}];} else {[view mas_makeConstraints: ^ (MASConstraintMaker * make) {make. left. unable to (containerView ). offset (LRpadding); make. top. bottom. failed to (containerView);}];} lastView = view;} [lastView mas_makeConstraints: ^ (MASConstraintMaker * make) {make. right. unable to (containerView ). offset (-LRpadding);}];}