Comment changer UITableView Section couleur et la couleur du Texte

J'ai UITableView qui remplit les dates de la plist et Même la Section du Titre est rempli de plist dans UITableView.il me donne la valeur par défaut blue section couleur et White la couleur du texte.c'est comme ça...

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {


NSString *key = nil;
if ([tableView isEqual:self.searchDisplayController.searchResultsTableView])
{
    key = [self.searchResults objectAtIndex:section];
}
else{
    key = [self.mySections objectAtIndex:section];
}

//   NSString *key = [self.mySections objectAtIndex:section];
return [NSString stringWithFormat:@"%@", key];

 }

.
Maintenant, j'ai besoin de modifier cette valeur par défaut la couleur du texte et de la Section de couleur, faire que je suis mise en œuvre du code montré ci-dessous.Mais il me donne sa propre UIView.

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *tempView=[[UIView alloc]initWithFrame:CGRectMake(0,200,300,244)];
    tempView.backgroundColor=[UIColor clearColor];

    UILabel *tempLabel=[[UILabel alloc]initWithFrame:CGRectMake(15,0,300,44)];
    tempLabel.backgroundColor=[UIColor clearColor]; 
    tempLabel.shadowColor = [UIColor blackColor];
    tempLabel.shadowOffset = CGSizeMake(0,2);
    tempLabel.textColor = [UIColor redColor]; //here you can change the text color of header.
    tempLabel.font = [UIFont fontWithName:@"Helvetica" size:fontSizeForHeaders];
    tempLabel.font = [UIFont boldSystemFontOfSize:fontSizeForHeaders];
        tempLabel.text=@"Header Text";

    [tempView addSubview:tempLabel];

    [tempLabel release];
    return tempView;
}
Que voulez-vous faire de votre en-tête de section? Le code de la tableView: viewForHeaderInSection: méthode devrait vous permettre de personnaliser la façon dont vous voulez que la section d'en-tête pour regarder.
je veux te UITableView Section de couleur noir, pour chaque section, et la couleur du Texte sur il devrait être rouge dire...mais comment faire

OriginalL'auteur Christien | 2012-12-22