Skip to content

Instantly share code, notes, and snippets.

@zeedark
Created February 6, 2012 14:37
Show Gist options
  • Save zeedark/1752457 to your computer and use it in GitHub Desktop.
Save zeedark/1752457 to your computer and use it in GitHub Desktop.
Modifying the default UITableViewCell's layout
#import <UIKit/UIKit.h>
@interface MyOwnTableViewCell : UITableViewCell
@end
#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