Last active
August 29, 2015 14:07
-
-
Save thiagoramos23/8bf4fe94d4589652c937 to your computer and use it in GitHub Desktop.
layoutSubviews
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ExTableViewCell.m | |
// TableViewExample | |
// | |
// Created by Thiago Ramos on 10/3/14. | |
// Copyright (c) 2014 br.com.exemplo.tableview. All rights reserved. | |
// | |
#import "ExTableViewCell.h" | |
@implementation ExTableViewCell | |
- (void)layoutSubviews | |
{ | |
[super layoutSubviews]; | |
NSDictionary *attributes = @{NSFontAttributeName: self.descricaoLabel.font}; | |
CGRect boundingRect = [self.descricaoLabel.text boundingRectWithSize:CGSizeMake(self.contentView.frame.size.width, MAXFLOAT) options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) attributes:attributes context:nil]; | |
self.descricaoLabel.frame = CGRectMake(self.descricaoLabel.frame.origin.x, self.descricaoLabel.frame.origin.y, self.contentView.frame.size.width, boundingRect.size.height); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment