Only individual study notes, Daniel do not spray
Code notation using Masonry
1 //Nickname2 3_namelableview =[[UILabel alloc]init];4 5[_namelableview Settextcolor:rgb ( +,164,232)];6 7_namelableview.font=[uifont systemfontofsize: -];8 9 //_namelableview.backgroundcolor = [Uicolor graycolor];Ten One[_namelableview SetText:@"Tom"]; A - [_souceview Addsubview:_namelableview]; - the //Sex Icons -_seximageview =[[Uiimageview alloc]init]; - -[_seximageview setimage:[uiimage imagenamed:@"Woman_icon"]]; + - [_souceview Addsubview:_seximageview]; + A[_namelableview mas_makeconstraints:^ (Masconstraintmaker *Make ) { atMake.top.equalTo (_namelableview.superview.mas_top). With.offset ( the); -Make.left.equalTo (_headbuttonview.mas_right). With.offset (Ten); - //Make.right.equalTo (_seximageview.mas_left). With.offset (5); - - //Make.height.mas_equalTo (+); -Make.width.mas_lessThanOrEqualTo (screenwidth- -); in }]; - to[_seximageview mas_makeconstraints:^ (Masconstraintmaker *Make ) { +Make.top.equalTo (_seximageview.superview.mas_top). With.offset ( -); -Make.left.equalTo (_namelableview.mas_right). With.offset (5); the * $Make.width.mas_equalTo ( -);Panax NotoginsengMake.height.mas_equalTo ( -); -}];
Uistoryboard notation
Image source Cocoachina User:Kiushuo
AutoLayout Uiimageview Change Position according to the width of the Uilabel