0

拍照后我需要显示 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];
4

1 回答 1

1

首先,我建议您使用库来加载 UIView,例如SVProgressHUD

此外,您需要使用 Threads 来做您想做的事情,看看这个链接

于 2013-01-10T18:44:42.030 回答