2013-01-09 55 views
0

我需要在拍照後顯示UIView(UIView顯示加載消息)。如何在拍攝照片後顯示UIView?

每當我需要證明我用這個代碼加載消息:

NSArray* loading = [[NSBundle mainBundle] loadNibNamed:@"LoadingViewController" 
                owner:self 
                options:nil]; 

self.loadingView = [ loading objectAtIndex: 0]; 

[self.view addSubview:self.loadingView]; 
[self.view bringSubviewToFront:self.loadingView]; 
self.loadingView is the loading UIView. 

我需要按後,顯示的UIView loadingView「完成」按鈕(在拍攝照片),我嘗試用這個:

- (void)imagePickerController:(UIImagePickerController *)picker 
didFinishPickingMediaWithInfo:(NSDictionary *)info 
{ 
    NSArray* loading = [[NSBundle mainBundle] loadNibNamed:@"LoadingViewController" 
                owner:self 
                options:nil]; 

    self.loadingView = [ loading objectAtIndex: 0]; 

    [picker.navigationBar addSubview:self.loadingView]; 
    [picker.navigationBar bringSubviewToFront:self.loadingView]; 
    /*image processing*/ 
} 

但是不工作。我也嘗試改變:

[picker.navigationBar addSubview:self.loadingView]; 
[picker.navigationBar bringSubviewToFront:self.loadingView]; 

[picker.view addSubview:self.loadingView]; 
[picker.view bringSubviewToFront:self.loadingView]; 

回答

1

所有我建議你使用一個庫加載的UIView像SVProgressHUD

你也需要使用線程你是什麼樣的一試圖做,看看this link