我想在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