2010-12-29 7 views
0

3つのラベルと1つの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:

私が何を言おうとすると、あなたが選択したときにということだと思いますLabelのテキスト色のセルそれは白に変わることはありませんか?

あなたはUILabelのため

UILabelを使用して強調表示状態を設定したい場合は*ラベル。

[label setHighlightedTextColor:[UIColor whiteColor]];

そうでなければ、あなたはそれのためのスクリーンショットをアップロードすることができます:) ..

+0

うん、それは正常に動作します –

関連する問題