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