开发者

Custom UIImagePicker removes navigationBar when pushing custom view

In my project I need to attach another uiviewcontroller to the end of the imagepicker chain.

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo 
{
uploadPhotoViewController * newView = [[uploadPhotoViewController alloc] initWithNibName:@"uploadPhotoViewController" bundle:nil];
    newView.c开发者_运维问答ontest = received;
    newView.receivedImage = img;
    newView.parentImagePicker = picker; // this doesn't help
    [picker pushViewController:newView animated:YES];

}

This works great, but when I use the camera as the source it clears the navigation bar and I can not get it to become visible. I have tried the usual:

-(void)viewWillAppear:(BOOL)animated 
{
    [super viewWillAppear:animated];
    self.wantsFullScreenLayout = FALSE;
    self.navigatioController.navigationBar.hidden = false;
    self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
    [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
}

The status bar will come back in the pushed view, but the navigation bar is another beast. I am guessing that since this is a modal that the navigationcontroller is being sent to the view stack underneath. Does anyone know how to address the image picker? I tried passing the image picker in as an object for the view controller as you can see in the first codeblock and then I tried addressing it like this:

    self.parentImagePicker.navigationBar.hidden = false;
    self.parentImagePicker.navigationBar.barStyle = UIBarStyleBlackTranslucent

But that didn't help either. So I'm stumped. Is their some ivar or something that will allow me to address the picker?


Oh cool, I figured it out. while the call

self.navigatioController.navigationBar.hidden = false;

does not work,

[self.navigationController setNavigationBarHidden:NO];

this one does.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜