0
我有一個實現委託方法的UIImageViewController對象: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];
我在圖像寫入目錄後調用[self.imageController dismissModalViewControllerAnimated:YES]。使用[picker.view addSubview:activiy]它只有在圖像寫入目錄後纔會出現。如何在寫入圖像之前顯示它? – Michael