Когда я устанавливаю UITableViewCells backgroundColor
в полупрозрачный цвет, он выглядит хорошо, но цвет не охватывает всю ячейку.
Область вокруг imageView
и accessoryView
выглядит как [UIColor clearColor]
...
Я пытался явно установить cell.accessoryView.backgroundColor
и cell.imageView.backgroundColor
, чтобы они были того же цвета, что и ячейка backgroundColor
, но это не работает. Он помещает крошечный прямоугольник вокруг иконки, но не расширяется, чтобы заполнить левый край. Правый край кажется незатронутым этим.
Как я могу это исправить?
РЕДАКТИРОВАТЬ : Вот код необработанной ячейки таблицы:
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
cell.opaque = NO;
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.backgroundColor = [UIColor colorWithRed:.1 green:.1 blue:.1 alpha:.4];
cell.textColor = [UIColor whiteColor];
}
cell.imageView.image = [icons objectAtIndex:indexPath.row];
cell.textLabel.text = [items objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}