ContentView 뒤에 Uitableview 분리기를 숨기고 있습니다
-
07-07-2019 - |
문제
왼쪽 이미지처럼 보이는 iPhone OS 3.0에서 그룹화 된 UitableView를 만들었습니다. 결과는 OS 3.1의 올바른 이미지입니다.
ImageView는 분리기 아래에 있습니다.
콘텐츠보기를 앞에 놓으려고했습니다. 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 아니오. 예를 들어 cell.clipsToBounds = NO;
제휴하지 않습니다 StackOverflow