Created
February 6, 2012 14:37
-
-
Save zeedark/1752457 to your computer and use it in GitHub Desktop.
Modifying the default UITableViewCell's layout
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
#import <UIKit/UIKit.h> | |
@interface MyOwnTableViewCell : UITableViewCell | |
@end |
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
#import "MyOwnTableViewCell.h" | |
@implementation MyOwnTableViewCell | |
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
{ | |
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
if (self) { | |
// Initialization code | |
} | |
return self; | |
} | |
- (void)setSelected:(BOOL)selected animated:(BOOL)animated | |
{ | |
[super setSelected:selected animated:animated]; | |
// Configure the view for the selected state | |
} | |
- (void) layoutSubviews | |
{ | |
[super layoutSubviews]; | |
CGRect frame = self.textLabel.frame; | |
frame.origin.x -= 5; | |
self.textLabel.frame = frame; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment