I am new to iOS development. I am trying to hide status bar in UIImagePickerController
. Whenever I click on \"Take photo\", status bar appears. It doesn\'t hide
-(IBAction)takePhoto:(UIButton *)sender
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self statusBar:TRUE];
[self presentViewController:picker animated:YES completion:NULL];
}
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
self.imageView.image = chosenImage;
[self statusBar:FALSE];
[picker dismissViewControllerAnimated:YES completion:NULL];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[self statusBar:FALSE];
[picker dismissViewControllerAnimated:YES completion:NULL];
}
-(void)statusBar:(BOOL)status
{
[[UIApplication sharedApplication] setStatusBarHidden:status];
}
that might help you to achieve what you want.