J'essaye d'ajouter un activityIndicator sur un modalViewController.Ajout d'un indicateur d'activité sur modalViewController iphone
Fondamentalement, je veux commencer à animer ce activityIndicator après que l'utilisateur appuie sur un bouton sur ce modalViewController. Mais ce qui se passe est ce que je fais avant de déclencher presentModalViewController sur ce modalViewController reste constant c'est-à-dire Si j'ajoute simplement activityIndicator et après avoir présenté modalView, alors même si je le lance il n'apparaît pas. Mais si Avant de prescrire ce modalViewController si je tire [activité startAnimating]; puis après avoir présenté l'activité modalView apparaît animant.
Donc, fondamentalement, je veux simplement ajouter le activityIndicator sur modalViewController et commencer à l'animer après avoir appuyé sur un bouton.
J'utilise le code suivant:
imageUploadView = [[UIViewController alloc]initWithNibName:nil bundle:nil];
CGRect frame = CGRectMake(140.0, 410.0, 25.0, 25.0);
loading = [[UIActivityIndicatorView alloc] initWithFrame:frame];
[loading sizeToFit];
loading.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin);
[imageUploadView.view addSubview:loading];
[_picker_ presentModalViewController:imageUploadView animated:YES];
Quelqu'un peut-il s'il vous plaît aider?
Merci d'avance.
Pouvez-vous s'il vous plaît être plus précis? Je suis un peu confus .. – neha
Il suffit de prendre votre point de vue, et appelez '[whatevertheviewis addSubview: anactivityindicatorview];' – jrtc27