I have a subclass of TableViewController,and initWithStyle method like:
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
[self.view setFrame:CGRectMake(0, 200, 320, 280)];
}
return self;
}
I want to add background image to my every TableViewCell,and image is displayed ,but it just displayed part of the image(my image size is 320 × 48),my code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.imageView.image = [UIImage imageNamed:@"cell_bg_light.png"];
return cell;
}
and the result:

You can try this one.
or you can use