2010-12-29 7 views
0

3 개의 레이블과 하나의 imageView로 사용자 지정 재사용 가능한 UITableViewCell을 만들고 있는데, 셀의 dealloc 메서드에서 해당 셀을 제거하려고합니다 ... 모두 괜찮습니다. 문제는 입니다. .. 그것은 그것은 나에게 그 문제를 피하기 위해 서로 도움이 겹치는의 종류 ...UITableViewCell 문제

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 
{ 
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) 
{ 
    NSLog(@"Address for cel called"); 
    NameLbl = [[UILabel alloc] initWithFrame:CGRectMake(5,5,140,20)]; 
    [self.contentView addSubview:NameLbl]; 
    NameLbl.font =[UIFont fontWithName:@"Times New Roman" size:15]; 
    NameLbl.font = [UIFont boldSystemFontOfSize:15]; 
    NameLbl.opaque=YES; 
    NameLbl.tag = 1001; 

    AddressLbl = [[UILabel alloc] initWithFrame:CGRectMake(5,25,140,20)]; 
    [self.contentView addSubview:AddressLbl]; 
    AddressLbl.font =[UIFont fontWithName:@"Times New Roman" size:15]; 
    AddressLbl.opaque=YES; 
    AddressLbl.tag = 1002; 

    CityStateZipLbl = [[UILabel alloc] initWithFrame:CGRectMake(5,50,150,20)]; 
    [self.contentView addSubview:CityStateZipLbl]; 
    CityStateZipLbl.opaque=YES; 
    CityStateZipLbl.tag = 1003; 
    CityStateZipLbl.font =[UIFont fontWithName:@"Times New Roman" size:15]; 

} 
return self; 
} 



- (void)dealloc { 
[CityStateZipLbl release]; 
[NameLbl release]; 
[AddressLbl release]; 

[super dealloc]; 
} 
+0

Balu,이 링크를 참조 할 수 있습니다이 질문에 대한 http://stackoverflow.com/questions/4441579/scrollable-table-having-a .. :) 그것에 대한 스크린 샷을 업로드 할 수 있습니다 -redraw-issue-doesnt-so-be-clearing to/4446714 # 4446714 – iPhoneDev

답변

1

는 @balu :

내가 무엇을 말하려고하는 것은 당신이 선택하면 것을 생각 레이블의 텍스트 색상 흑인은 백인으로 바뀌지 않습니까?

당신이 다음 UILabel의에 대한

UILabel의를 사용하여 강조 상태를 구성하려면 * 라벨;

[label setHighlightedTextColor : [UIColor whiteColor]];

그렇지 않으면

+0

네, 잘 작동합니다. –