I am using the following code to display a UIPickerController along with its overlay view:
-(void) viewDidLoad{
self.overlayView = [[OverlayViewController alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.overlayView.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.modalPresentationStyle = UIModalPresentationFullScreen;
imagePickerController.cameraOverlayView.frame=self.view.frame;
imagePickerController.showsCameraControls = NO;
imagePickerController.navigationBarHidden = YES;
imagePickerController.toolbarHidden = YES;
//imagePickerController.cameraViewTransform = CGAffineTransformScale(imagePickerController.cameraViewTransform, 1.0, 1.3);
imagePickerController.delegate = self.overlayView;
// as a delegate we will be notified when pictures are taken and when to dismiss the image picker
[self.view addSubview:imagePickerController.view];
imagePickerController.cameraOverlayView =self.overlayView.view;
} else {
[self.view addSubview:self.overlayView.view];
}
}
Yet the screen displays a black bar at the bottom when keeping the iPhone in portrait. No bar appears in landscape as you may see in the attached screen-shots. How to fix it?