2013-05-20 3 views
0

표보기에서 셀의 이미지를 설정했지만 셀을 구분하는 선이 표시되지 않습니다. 나는 무엇을 잘못 했는가?표보기 설정 셀 이미지

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *mbTableIdentifier = @"SimpleTableItem"; 
    UIImageView *image = [[UIImageView alloc]init]; 
    image.image = [UIImage imageNamed:@"BarButton.png"]; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:mbTableIdentifier]; 

    if (cell == nil) 
    { 
     cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:mbTableIdentifier]; 
     cell.textLabel.font=[UIFont systemFontOfSize:16.0]; 
    } 

    // cell.backgroundView = [[CustomCellBackground alloc] init]; 
    cell.selectedBackgroundView = [[CustomCellBackground alloc] init]; 
    cell.textLabel.backgroundColor = [UIColor clearColor]; 
    cell.textLabel.highlightedTextColor = [UIColor darkGrayColor]; 
    cell.textLabel.textColor = [UIColor whiteColor]; 
    cell.backgroundView = image; 

    cell.textLabel.text = [mbTableData objectAtIndex:indexPath.row]; 
    return cell; 
} 

편집 : 28 : 40.392 KFBNewsroom 나는

2013년 5월 20일 07 내 분리 스타일과 색상 로그인 한 [1274을 : C07] 세포 분리기 스타일 : 2 구분 색상 : UIDeviceRGBColorSpace 0.67 0.67 0.67 1 2013-05-20 07 : 28 : 40.393 KFBNewsroom [1274 : c07] 셀 구분 기호 스타일 : 2 구분 기호 색상 : UIDeviceRGBColorSpace 0.67 0.67 0.67 1 2013-05-20 07 : 28 : 40.393 KFBNewsroom [1274 : c07] 셀 구분 기호 스타일 : 2 구분 기호 색상 : UIDeviceRGBColorSpace 0.67 0.67 0.67 1

편집 : 문제의 스크린 샷 enter image description here

편집 : 내 이미지 맨 아래에 1 픽셀 줄을 추가하여 문제를 해결했습니다.

+0

"나는 이미지를 fo로 설정했습니다. r 내 테이블 뷰에있는 셀보기 "이 작업을 어디에서 했습니까? 나는 당신의 게시물에서 그것을 볼 수 없습니다. – rdelmar

+0

cell.backgroundView = image를 설정했습니다. – raginggoat

+0

죄송합니다. 문제가 무엇입니까? 그 이미지가 보이지 않습니까? 분할 선이 귀하의 문제와 관련이 없다는 사실이 분명하지 않습니다. – rdelmar

답변

0
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return 50; 
} 

tableview 셀의 높이를 늘리는 위임 방법입니다. 시도해보십시오.

+0

그 중 하나가 작동하지 않았다. – raginggoat

0

XIB에서 tableview 속성으로 이동하여 구분 기호가 '없음'으로 설정되어 있는지 확인하십시오. 이 경우에는 XIB에게

enter image description here

또는 사용

yourTableView.separatorStyle=UITableViewCellSeparatorStyleSingleLine; 

코딩에서 드롭 다운에서 '단일 선'... 당신의있는 tableView의

+0

그것을 시도했다. 선은 여전히 ​​표시되지 않습니다. – raginggoat

0

설정 속성으로 설정해야합니다 테이블 높이를 늘리십시오 (이미지 높이 이상)

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return 100; 
} 
+0

나는 그것을 시도했다. – raginggoat

+0

이미지의 높이가 어떻게됩니까? – Rajneesh071

+0

구분선의 색을 바꿉니다. – Rajneesh071

관련 문제