我想在modalViewController上添加一个activityIndicator。在modalViewController上添加一个activityIndicator iphone
基本上我想在用户按下这个modalViewController上的一个按钮后开始动画这个activityIndicator。但是发生了什么事情是我在做这个modalViewController的时候使用的presentModalViewController保持不变,即使我只是简单地添加activityIndicator,然后展示了modalView,然后即使我启动它也不会显示出来。但如果之前preseting这个modalViewController,如果我开火[活动startAnimating];然后在呈现modalView活动后显示动画。
所以基本上,我想简单地在modalViewController上添加activityIndicator并在按下按钮后开始动画。
我用下面的代码:
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];
任何人可以请帮助?
Thanx提前。
能否请您具体?我有点困惑.. – neha 2010-07-15 13:52:18
只要你的看法,并调用'[whatevertheviewis addSubview:anactivityindicatorview];' – jrtc27 2010-07-15 14:40:53