2011-03-17 5 views

답변

6

UITableViewCell에는 읽기 전용 속성 contentView가 있습니다. 셀 객체의 내용보기를 반환합니다. 필요에 따라이 뷰를 조작하고 하위 뷰를 추가하고 원하는 것을 할 수 있습니다. 두 번째 방법은 UITableViewCell을 하위 클래스로 만들고 인터페이스 작성기에서 디자인하는 것입니다.

1

link은 기본적인 아이디어를 얻는 데 도움이 될 수 있습니다.

또 다른 one

0

은 상속있는 UITableViewCell하여 사용자 정의 셀을 확인하고

3

는 애플이 제공하는 샘플의 볼나요 기본 테이블 뷰 셀의 대신에 사용자 정의 셀을 사용합니까?

  • Table View Suite
  • Advanced Table View Cells

    • 다른 사람들이 많이 있습니다.

    1

    UITableViewCell contentView에 추가 할 수 있습니다. 나는 다음과 같이 사용했다.

    if (cell == nil) { 
    
         cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 
    
         UILabel* lbl=[[UILabel alloc] initWithFrame:CGRectMake(10, 5, 80, 35)]; 
         [email protected]"Email"; 
         lbl.tag=1; 
         lbl.backgroundColor=[UIColor clearColor]; 
         lbl.font=[UIFont fontWithName:@"Helvetica-Bold" size:20]; 
         [cell.contentView addSubview:lbl]; 
    } 
    
    UILabel* lbl=(UILabel*)[cell.contentView viewWithTag:1]; 
    [email protected]"Your Text";