在UITabBarController内部解散时,UIImagePickerController源(Camera)显示空白屏幕

时间:2010-07-27 16:46:42

标签: iphone uiimagepickercontroller

我的应用程序中有以下层次结构:

UINavigationController 
     |__ UITabBarController
             |__ UINavigationController
                     |__ ViewProfilePhotoController (*presentModalViewController:picker is done here)

我遇到的问题是当我按下取消并在ViewProfilePhotoController中关闭我的UIImagePickerController时,我得到一个只有状态栏的空白屏幕,而不是想要在ViewProfilePhotoController(实际照片)中显示的视图。

这种行为真的很奇怪,因为我通过从我的应用程序层次结构中取出UITabBarController来尝试相同的代码,并且此问题不存在,并且一切都按预期工作。相信我在ViewProfilePhotoController中正确配置了所有代表,我试图将其修复几个小时。

我还通过设置RIGHT父视图来检查UIImagePickerController中的所有可能配置,到目前为止还没有任何工作。

我也尝试过正确的级联 - viewWillAppear - viewWillDis在层次结构中显示并且仍然没有运气。

任何见解都会非常感激。感谢名单

1 个答案:

答案 0 :(得分:0)

好的,所以在很多个小时之后,我找到了解决方案。

In my rootController UINavigationController I was adding 2 UIViewControllers to the navigation stack and then after the authentication happened I did the following to add my UITabBarController:

[self.navigationController initWithRootViewController:theTabController];

我在第二个UIViewController中添加了UITabController作为rootViewController,而UIImagePickerController不喜欢这个,以及稍后在导航中添加的时间。它将被解雇,留下白屏。

相反。我通过我的appDelegate调用了我的堆栈的根UIViewController并添加了UITabBarController,如下所示:

- (void) authSucceded {

       [self createTabBarController];

       self.theTabController.view.tag = 2345;
       [self.view addSubview:self.theTabController.view];
}

Voila这是我的解决方案......