views:

58

answers:

1

Hi All,

I wants to show Camera view in between Navigation bar & Tab bar, So I added the UIImagePickerController object as follows.

                picker = [[Camera3DViewController alloc] init];

  picker.allowsImageEditing = NO;

         picker.sourceType = UIImagePickerControllerSourceTypeCamera;

  picker.showsCameraControls = NO;

  picker.view.transform = CGAffineTransformScale(picker.view.transform, 1, 1);

  [self.view addSubview:picker.view];

  [picker viewWillAppear:YES];

  [picker viewDidAppear:YES];

Note that Camera3DViewController is Sub Class of UIImagePickerController Class.

Camera get display but status bar does not shown.

so I use,

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];

but still it does not show the status bar.

Please guide me to solve the above problem.

Thanks

A: 

I subclassed UIImagePictureController and added:

- (void) viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated]; 

    [[UIApplication sharedApplication] setStatusBarHidden:NO animated:animated];
}

It is important to show status after [super viewDidAppear:animated]; call, else it didn't appear. Also it is important to call superclass method.

mOlind