在另一个Modal之上加载ModalViewController [英] ModalViewController loading on top of another Modal

查看:87
本文介绍了在另一个Modal之上加载ModalViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能有更好的方法,如果有的话,请直接给我指导.

There may be a better way to do this, and please direct me if there is.

我正在用viewDidAppear中的overlayView创建一个 UIImagePickerController ,用于从库中选择",拍照",闪光灯",相机源"等.

I'm creating an UIImagePickerController with an overlayView in viewDidAppear for 'choose from library', 'take photo', 'flash' 'camera source', etc.

// Set up the camera
imagePicker = [[UIImagePickerController alloc] 
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;

imagePicker.cameraOverlayView = [self cameraOverlayView];
cameraOverlayView.backgroundColor = [UIColor clearColor];
imagePicker.showsCameraControls = NO;
imagePicker.toolbarHidden = YES;

imagePicker.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:imagePicker animated:YES]; 

然后我有一个IBAction,它调用我的从库中选择功能",并加载另一个UIImagePickerController以从设备中选择照片.

I then have an IBAction that calls my 'choose from library function', loading another UIImagePickerController to choose a photo from the device.

- (IBAction)library:(id)sender
{
    UIImagePickerController *libraryPicker = [[[UIImagePickerController alloc] init] autorelease];

    libraryPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    libraryPicker.delegate = self;

    [self.imagePicker presentModalViewController:libraryPicker animated:YES];
}

当显示从库中选择"模式时,我在顶部出现一个状态栏大小的白色条.我知道这与在模态上叠加模态有关,但是我不知道如何解决. (即,我的拍照"视图布局导航良好,尽管没有显示其他从图书馆选择"模式).

I'm getting a white bar across the top about the size of a status bar when the 'choose from library' modal is presented. I know it has something to do with overlaying a modal on top of a modal, but I don't know how to solve it. (IE, my view layout for 'take photo' navigates fine, although doesn't display the additional 'choose from library' modal).

有什么想法吗?任何帮助或指示将不胜感激!

Any ideas? Any help or direction would be greatly appreciated!

推荐答案

尝试

[self presentModalViewController:libraryPicker animated:YES];

代替

[self.imagePicker presentModalViewController:libraryPicker animated:YES];

这篇关于在另一个Modal之上加载ModalViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆