backgroundColor
set
, iyi görünüyor, ama renk tüm hücre kapsamaz.UITableViewCell saydam arka plan
imageView
ve accessoryView
çevresi hücre en backgroundColor
aynı renkte olmasını açıkça cell.accessoryView.backgroundColor
ve cell.imageView.backgroundColor
ayarlama denedim
... [UIColor clearColor]
olarak geliyor, ancak edilir çalışmıyor Simgenin etrafında küçük bir kutu koyar, ancak sol kenarı doldurmak için genişlemez. Sağ kenar bundan etkilenmez gibi görünüyor.
Bunu nasıl düzeltebilirim?
DÜZENLEME:
- (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;
}
aslında 1 şey daha yapmak zorunda kaldı. Cell.textLabel.backgroundColor ayarlanması gerekiyor * Hücrenin arka plan rengi * AFTER *. Bunu neden yapmaya ihtiyacım olduğuna dair bir fikrim yok, ama şimdi çalışıyor. Teşekkürler Mike! –