Escondendo separador UITableView atrás do contentView
-
07-07-2019 - |
Pergunta
Eu fiz um UITableView agrupados em iPhone OS 3.0, que parecia a imagem esquerda. O resultado é a imagem certa no OS 3.1.
O imageView está sob os separadores.
Eu tentei colocar a exibição de conteúdo na frente. O decoro separatorStyle parece ignorado quando o tableView é em estilo agrupado (para desenhar o separador de mim mesmo). Mudando a cor do separador dá cordas resultados.
Obrigado por sua ajuda!
Edit: Este é o código sem alteração feita:
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.font = [UIFont boldSystemFontOfSize:18.0];
}
cell.textLabel.text = [[metro.arretDirection objectAtIndex:indexPath.row] name];
NSString* name;
if (indexPath.row == 0) {
name = @"Begining";
}
else if (indexPath.row + 1 == [metro.arretDirection count]) {
name = @"End";
}
else {
if ([[[metro.arretDirection objectAtIndex:indexPath.row] lines] count]== 1) name = @"Little";
else name = @"Big";
}
UIImage* metroImage = [[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%i%@.png", metro.metroNumber, name]]];
cell.imageView.image = metroImage;
[metroImage release];
return cell;
Solução 2
A resposta foi realmente muito simples, basta adicionar um UIImageView
na célula um lugar-lo corretamente em vez de usar o construída em imageView.
Outras dicas
Na definição tentativa de células clipsToBounds para NO. por exemplo cell.clipsToBounds = NO;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow