Je souhaite ajouter un indicateur UIActivityIndicator à UITableViewCell. Comment puis-je faire?Comment ajouter UIActivityIndicatorView à UITableViewCell?
0
A
Répondre
3
essayer comme ça
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"NoReuse"] autorelease];
cell.textLabel.text = @"Loading...";
UIActivityIndicatorView *spinner = [[[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease];
// Spacer is a 1x1 transparent png
UIImage *spacer = [UIImage imageNamed:@"spacer"];
UIGraphicsBeginImageContext(spinner.frame.size);
[spacer drawInRect:CGRectMake(0,0,spinner.frame.size.width,spinner.frame.size.height)];
UIImage* resizedSpacer = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
cell.imageView.image = resizedSpacer;
[cell.imageView addSubview:spinner];
[spinner startAnimating];
return cell;
1
UIActivityIndicatorView *spinner = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease];
spinner.frame = CGRectMake(205.0f, 0.0f, 44.0f, 44.0f);
spinner.tag = 3;
[cell.contentView addSubview:spinner];
+1
Si vous fournissez du code, s'il vous plaît élaborer pour le rendre clair à l'OP. – Abbas
Questions connexes
- 1. Comment positionner un UIActivityIndicatorView dans un UITableViewCell
- 2. Comment ajouter UIActivityIndicatorView comme rightView
- 3. Ajouter UIActivityIndicatorView dans UIBarButton
- 4. SDK iPhone: Ajout d'un UIActivityIndicatorView à un UITableViewCell
- 5. Comment ajouter Biseau à UITableViewCell
- 6. Comment ajouter une image dans UIActivityIndicatorView
- 7. Comment ajouter un titre ou un tag à UIActivityIndicatorView
- 8. Comment ajouter un UIActivityIndicatorView à l'intérieur d'un AlertView
- 9. UITableviewcell accessoryview disparaît après UIActivityIndicatorView joue dans tableviewcell
- 10. iOS - Ajouter Badge à UITableViewCell
- 11. Comment ajouter une vue spécifique à uitableviewcell?
- 12. Comment ajouter textfield dans uitableviewcell
- 13. Comment ajouter ImageButton dans uitableviewcell
- 14. bouton Ajouter dans UITableViewCell
- 15. Problème UIActivityIndicatorView
- 16. Ajouter un graphique supplémentaire à un UITableViewCell
- 17. ajouter des sous-vues à UITableViewCell numéro
- 18. ajouter des sous-vues à UITableViewCell
- 19. Comment ajouter une image dans UITableViewCell
- 20. changer recherche loupe à UIActivityIndicatorView
- 21. Ajouter/Supprimer UITableViewCell avec animation?
- 22. Sous-classe UITableViewCell - comment ajouter un bouton à certaines lignes
- 23. iphone sdk: Comment ajouter un bouton à uitableviewCell?
- 24. iphone UITableViewCell ajouter une image
- 25. UIActivityIndicatorView ne fonctionne pas (obtention des autorisations Facebook affectant UIActivityIndicatorView)
- 26. affichera NSObject show UIActivityIndicatorView?
- 27. Objectif C - UIActivityIndicatorView positionnement
- 28. UIActivityindicatorView dans l'étiquette possible?
- 29. UIActivityIndicatorView ou similaire quelqu'un
- 30. UIActivityindicatorView dans MPMoviePlayerController
@ sonbt91 est-il fonctionne – Sport
Merci, ça n'a pas fonctionné! – sonbt91