我有一个实现委托方法的 UIImageViewController 对象:
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
在该委托方法中,我试图呈现一个 UIActivityIndicatorView 以提醒用户图像正在写入目录。我尝试了多种方法来访问视图并添加 UIActivityIndicator 对象无济于事。
activity = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
CGPoint ctr = CGPointMake(160, 240);
activity.center = ctr;
[picker.navigationController.visibleViewController.view addSubview:activity];
[activity startAnimating];