我在MainWindow前添加了UIView
。我希望在那个视图中呈现相机选择器。但相机选择器始终位于UIView
。
如何将拣货员带到前面。我已经检查了 bringSubviewToFront:但没有效果
用于呈现选择器的代码
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.allowsEditing=TRUE;
picker.allowsEditing = true;
[navController presentViewController:picker animated:YES completion:nil];
}
以下是用于将我的视图添加到窗口的代码。
[self.window addSubview:myView.view];
[myView didMoveToParentViewController:self.window.rootViewController];
[appDelegate.window bringSubviewToFront:myView];
提前致谢。
答案 0 :(得分:0)
你试过这种方式吗?
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
[<yourView> addSubview:picker.view];