Skip to content

Instantly share code, notes, and snippets.

@vtim
Created May 23, 2014 20:41
Show Gist options
  • Save vtim/00d30d58927fd87b1443 to your computer and use it in GitHub Desktop.
Save vtim/00d30d58927fd87b1443 to your computer and use it in GitHub Desktop.
Fixes label heights after rotation
- (void)viewDidLayoutSubviews
{
dispatch_async(dispatch_get_main_queue(), ^{
self.titleLabel.preferredMaxLayoutWidth = self.titleLabel.bounds.size.width;
self.dateAuthorLabel.preferredMaxLayoutWidth = self.titleLabel.bounds.size.width;
self.introLabel.preferredMaxLayoutWidth = self.titleLabel.bounds.size.width;
self.textLabel.preferredMaxLayoutWidth = self.titleLabel.bounds.size.width;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment