Je le code et donne le résultat de la capture d'écran ci-dessous. C'est dans la tableView: cellForRowAtIndexPath: méthode. Je ne sais pas pourquoi le texte au-dessus des barres ne montre pas. Quelqu'un a-t-il une idée? Je vous remercie.UITableViewCell ne pas montrer dans les UILabel
cell.textLabel.text = @"";
cell.accessoryType = UITableViewCellAccessoryNone;
cell.textAlignment = UITextAlignmentLeft;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
UILabel * label = [[UILabel alloc] initWithFrame: cell.textLabel.frame];
label.backgroundColor = [UIColor clearColor];
label.text = [NSString stringWithFormat:@"%.1f%% (%i)",([[options_votes objectAtIndex: [indexPath row]] intValue] * 100.0/total_votes),[[options_votes objectAtIndex: [indexPath row]] intValue]];
NSLog(@"%@",[NSString stringWithFormat:@"%.1f%% (%i)",([[options_votes objectAtIndex: [indexPath row]] intValue] * 100.0/total_votes),[[options_votes objectAtIndex: [indexPath row]] intValue]]);
label.textAlignment = UITextAlignmentRight;
[cell.contentView addSubview:label];
[label release];
label = [[UILabel alloc] initWithFrame: cell.textLabel.frame];
label.backgroundColor = [UIColor clearColor];
label.text = [options objectAtIndex:[indexPath row]];
NSLog(@"%@",[options objectAtIndex:[indexPath row]]);
label.textAlignment = UITextAlignmentLeft;
[cell.contentView addSubview:label];
[label release];
UIImageView * image_view = [[UIImageView alloc] initWithImage:nav_delegate->back_bar];
image_view.frame = CGRectMake(10, 44, 280, 10);
[cell.contentView addSubview:image_view];
[image_view release];
image_view = [[UIImageView alloc] initWithImage:nav_delegate->blue_bar];
image_view.frame = CGRectMake(10, 44, 5 + [[options_votes objectAtIndex: [indexPath row]] intValue] * 275.0/total_votes, 10);
[cell.contentView addSubview:image_view];
[image_view release];
merci D'accord. Cela fonctionne ailleurs en utilisant ce cadre. Je vais essayer de le changer si –
Cheers. Cela a fonctionné un régal. –