Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -(void) viewDidLayoutSubviews
  2. {
  3.     [super viewDidLayoutSubviews];
  4.     //NSLog(@"aligning...");
  5.     NSDictionary *attributes = @{NSFontAttributeName: self.topLabel.font};
  6.    
  7.     CGRect rect = [self.topLabel.text boundingRectWithSize:CGSizeMake(self.topLabel.frame.size.width, CGFLOAT_MAX)
  8.                                               options:NSStringDrawingUsesLineFragmentOrigin
  9.                                            attributes:attributes
  10.                                               context:nil];
  11.     CGRect llR=self.lineLabel.frame;
  12.     llR.size.width=rect.size.width;
  13.     llR.origin.x=llR.origin.x+self.topLabel.frame.size.width-rect.size.width;
  14.     self.lineLabel.frame=llR;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement