Вопрос

Я сделал сгруппированный UITableView в iPhone OS 3.0, который выглядел как изображение слева. В результате получается правильный образ в ОС 3.1.

imageView находится под разделителями.

Я попытался поместить представление контента впереди. Свойство separatorStyle, кажется, игнорируется, когда tableView находится в сгруппированном стиле (чтобы нарисовать разделитель самостоятельно). Изменение цвета разделителя дает результаты строк.

Спасибо за вашу помощь!

Редактировать: это код без изменений:

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;
Это было полезно?

Решение 2

Ответ на самом деле был довольно прост: просто добавьте UIImageView в ячейку и поместите его правильно вместо использования встроенного imageView.

Другие советы

В ячейке попробуйте установить clipsToBounds to NO. например, cell.clipsToBounds = NO;

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top