Skip to content

Instantly share code, notes, and snippets.

@akshay1188
Created October 17, 2012 09:37
Show Gist options
  • Save akshay1188/3904688 to your computer and use it in GitHub Desktop.
Save akshay1188/3904688 to your computer and use it in GitHub Desktop.
UILabel category to bottom align label texts (Generally when they have different font sizes)
- (CGFloat)topAfterBottomAligningWithLabel:(UILabel *)label{
return (label.frame.origin.y - ((label.frame.origin.y + self.frame.size.height) - (label.frame.origin.y + label.frame.size.height)) + (label.font.descender - self.font.descender));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment