When I set the cell's backgroundView
with a UIImageView
, there is space on between the left side of the UITableView
and the left edge of the backgroundView
. Why is this?
Here's the code that sets the background within a subclass on UITableViewCell
:
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
self.contentView.backgroundColor = [UIColor clearColor];
NSString *imageName = @"invite_bg";
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 502)];
self.backgroundView = imageView;
self.imageView.image = [UIImage imageNamed:imageName];
}
}