I am trying to display my data in a grouped table as below :
As you can
Just try with it:
Set the cell background view to YourcellImage & cells background color to clear color.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
[cell setBackgroundColor:[UIColor clearColor]];
UIImage *backgroundImage = nil;
UIImageView *backgroundView = nil;
backgroundImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"YourYellowCellImage"ofType:@"png"]];
backgroundView = [[UIImageView alloc]initWithImage:backgroundImage];
backgroundView.frame = CGRectMake(0, 0, 600, 80); // Over here give your cell size
cell.backgroundColor = [UIColor clearColor];
cell.backgroundView =backgroundView;
[backgroundView release];
}
//Over your set your Label Value
return cell;
}
Try
- (void)tableView: (UITableView*)tableView willDisplayCell: (UITableViewCell*)cell forRowAtIndexPath: (NSIndexPath*)indexPath
{
cell.backgroundColor = [UIColor clearColor];
}
Clearing the background in the cellForRowAtIndex method should work
[cell setBackgroundColor:[UIColor clearColor]];
try also to clear the background in the viewWillAppear and if something weird happens, clear the project and rebuild.
I was facing the same problem. And got to know It has nothing to do with cell's background.
The issue is with background of the tableview which causes this weird corners, So
self.tableview.backgroundColor = [UIColor clearColor];
in viewWillAppear
will solve the issue :)
Try this code.....
customerTable.separatorColor = [UIColor clearColor];
Try
customerTable.backgroundColor = [UIColor clearColor]; customerTable.opaque = NO; customerTable.backgroundView = nil;