的backgroundColor为TableViewCell不工作
就像你在图片中看到,我有一个的tableView(视图tableviewController的),蓝色的观点是为第一个headerView,当我点击它,它崩溃了一些细胞,但我的问题是,单元格的背景的第一部分tableView(云)作为背景[在这张图片中我设置单元格的背景颜色清除,但如果我给它设置一个颜色左右(LR中的图片)部分仍然存在]
我尝试:cell.layer.masksToBounds = YES;和cell.contentView.layer.masksToBounds = YES;
我该如何解决这个问题?以及为什么该单元格将tableView BackGroundColor [image]的第一部分作为BackGroundColor?
编辑:一些代码(我覆盖在这样的背景故事板的所有值...)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"clientCell";
ClientCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if ([[[[[[DataManager sharedManager] clientsList] objectAtIndex:indexPath.section] objectForKey:@"rewards"] objectAtIndex:indexPath.row] valueForKey:@"description"] != [NSNull null])
{
cell.voucherDescription.text = [[[[[[DataManager sharedManager] clientsList] objectAtIndex:indexPath.section] objectForKey:@"rewards"] objectAtIndex:indexPath.row] valueForKey:@"description"];
}
//configure more labels ..
[cell setBackgroundColor:[UIColor clearColor]];
[cell.voucherDescription setFont:[UIFont fontWithName:SharkFontSystemeName size:17]];
return cell;
}
在viewDidLoad中
:
[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]]];
尝试将图像视图添加到单元格作为addsubview,并且可以根据您的要求为图像视图设置框架。 – Mrunal 2012-07-25 11:18:18
这不起作用,我认为这个问题不是'只是'在单元格中,因为如果我使用颜色代替“colorWithPatternImage:”似乎工作正常。 – 2012-07-25 12:09:52
请添加您的代码以更好地了解您的问题。 – Mrunal 2012-07-25 14:42:07