UILabel Vertical Align


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. CGSize maximumSize = CGSizeMake(300, 9999);
  2. NSString *dateString = @"The date today is January 1st, 1999";
  3. UIFont *dateFont = [UIFont fontWithName:@"Helvetica" size:14];
  4. CGSize dateStringSize = [dateString sizeWithFont:dateFont
  5. constrainedToSize:maximumSize
  6. lineBreakMode:self.dateLabel.lineBreakMode];
  7.  
  8. CGRect dateFrame = CGRectMake(10, 10, 300, dateStringSize.height);
  9.  
  10. self.dateLabel.frame = dateFrame;

URL: http://stackoverflow.com/questions/1054558/uilabel-vertical-alignment

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.